Problems with the LLVM-based compiler

While we put big efforts to make a reasonably robust compiler, you may encounter a bug or problem when using it. There are several errors of different nature that you may run into:

  • The compiler ends abnormally with an internal error telling you to report a bug.

  • The compiler does not crash but gives an error on your input code and compilation stops, as if your code were not valid.

  • The compiler forgets something in the generated code and linking fails.

  • Compilation succeeds but the program crashes at runtime.

How can you help us to solve the problem quicker in the LLVM compiler?

If clang crashes, it will generate a reproducer automatically with a message like this:

********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/t-56517d.c
clang: note: diagnostic msg: /tmp/t-56517d.sh
clang: note: diagnostic msg:

********************

Send us an email to pm-tools at bsc.es with those two files attached. Reproducer files are usually very large. Please compress them with gzip (or bzip2 or any similar tool).

If clang does not crash, then follow the next steps to obtain a reproducer:

  1. Figure out the compilation command of the file that fails to compile. Make sure you can replicate the problem using that compilation command alone.

  2. Add the option -gen-reproducer to the compilation command. Clang will generate a reproducer. Send us the reproducer files.

If for some reason the option -gen-reproducer does not work for you, use the following steps:

  1. Figure out the compilation command of the file that fails to compile. Make sure you can replicate the problem using that compilation command alone.

  2. If your compilation command includes -c, replace it by -E. If it does not include -c simply add -E.

  3. If your compilation command includes -o file (or -o file.o) replace it by -o file.ii. If it does not include -o, simply add -o file.ii.

  4. Now run the compiler with this modified compilation command. It should have generated a file.ii.

  5. Send us that file. Please compress it with gzip (or bzip2 or any similar tool)