-
Bug
-
Resolution: Fixed
-
Medium
-
Code Generation Tools
-
CODEGEN-11890
-
-
-
default
Build attached test case with code coverage and 32bit pointers
tiarmclang -O0 -mcpu=cortex-m0plus -mfloat-abi=soft dl_flashctl.c -c -fcoverage-mapping -fmcdc -fprofile-counter-size=32 -fprofile-instr-generate
This results in an error that is difficult to decipher:
fatal error: error in backend: Do not know how to expand this operator's operand!
The actual cause is that the compiler errs when lowering an "increment.step" intrinsic that is instrumented to increment a 32bit counter using a 64bit value. Because the two values are not the same type, the lowering fails. Standard increments work just fine. The compiler uses the increment.step intrinsic to conditionally increment the counter by using the result of a comparison operation as its increment "step value".
Workaround is to avoid using 32bit counters: -fprofile-counter-size=64 (or remove the option from the build).