You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Clang source-level instrumentation (the -fprofile-instr-generate option) does not honor the function attribute naked and generates a prologue that might interfere with the function body. For example, the following code
When compiled with the current trunk build of Clang, using the flags -target arm-none-eabi -march=armv8-a -O -fprofile-instr-generate produces the following LLVM IR for the function semihost:
Clang source-level instrumentation (the `-fprofile-instr-generate` option) does not honor the function attribute `naked` and generates a prologue that might interfere with the function body. For example, the following code
When compiled with the current trunk build of Clang, using the flags -target arm-none-eabi -march=armv8-a -O -fprofile-instr-generate produces the following LLVM IR for the function semihost:
Clang source-level instrumentation (the
-fprofile-instr-generate
option) does not honor the function attributenaked
and generates a prologue that might interfere with the function body. For example, the following codeWhen compiled with the current trunk build of Clang, using the flags
-target arm-none-eabi -march=armv8-a -O -fprofile-instr-generate
produces the following LLVM IR for the functionsemihost
:Which, in turn, gets compiled into the following assembly:
This is incorrect because the function parameters are passed in the registers r0 and r1, and they get overwritten.
I think the correct behavior would be not to instrument naked functions, similarly to how it is done for IR-level coverage: #108552
The text was updated successfully, but these errors were encountered: