Wrong static analysis when using custom compiler

We are working with a GCC-based compiler for a custom architecture (Tricore AURIX from Infineon.) I succesfully setup project using the custom compiler feature, starting from example “Makefile-Tasking-Tricore” found in the Jetbrains Github repository [1].

Almost everything is working correctly, except that some static analysis report error when there is a divergence between “normal” GCC and this custom version.

For example, Clion reports the error “invalid input constraint ‘d’ in asm” in the following piece of code:

__asm__ volatile ("mtcr LO:%0, %1"
                  :: "i" (__regaddr), "d" (__val) : "memory");

which is technically correct, because “normal” gcc doesn't provide this input constraint. How can I make sure inspections works with this compiler?

[1] https://github.com/JetBrains/clion-custom-defined-compiler-examples


Please sign in to leave a comment.