Original bug ID: 5698
When compiling large machine-generated code, the assembler files (*.s) sometimes reuse labels (.L200000 in the example below), which breaks the compilation.
We suspect this is related to cross-library inlining.
The example below, generate_code_1.ml, will generate two files: tons_of_match_statements.ml and tons_of_match_statements_b.ml, which, when compiled with the options given below (in particular, -inline 20), cause the label .L200000 to be used twice in the assembler source (tons_of_match_statements_b.s).
This is of course an artificial example. Our real-life code which triggers this bug creates hundreds of label conflicts in a single .s file (which I wasn't able to reproduce using simpler code).
Steps to reproduce
$ ocamlopt -version
$ cat ./genererate_code_1.ml
let kk = 6010
let generate_function oc name k default =
let generate_module_a () =
let generate_module_b () =
let () =
$ ocaml ./generate_code_1.ml && ocamlopt -thread -w @a-4-7-9-29-28 -strict-sequence -annot -inline 20 -nodynlink -g -S tons_of_match_statements.ml tons_of_match_statements_b.ml
tons_of_match_statements_b.s: Assembler messages:
$ /bin/egrep --color=always -5 '^[.]L200000' ./tons_of_match_statements_b.s
The text was updated successfully, but these errors were encountered: