Hi,Query:
Is there a way to generate object code that avoids using unprivileged instructions - `ldrbt`, `ldrsht`, `ldrt` - using ARMCLANG compiler (version 6.16) ?Some light on how the compiler chooses to generate one of the two variants (privileged / unprivileged ) instructions for a given code would also be helpful.
ldrbt`, `ldrsht`, `ldrt
Background:
We have a specific case where we see that an application using a library built using ARMCLANG for Cortex-M55 is crashing on our test board.
On debugging the root cause for the crash, we see that the crash is happening at a unprivileged access (ldrbt, ldrsht, ldrt) ARM instruction.The same library(source) from GCC build works perfectly fine.We have another observation with ARMCLANG build.When we break the build steps: a particular C source file is converted to assembly first (using ARMCLANG again) and converted to object code later, the resulting library build does not have unprivileged access instructions and works without any crash.TL;DR - Same source compiled with GCC build works fine whereas ARMCLANG build produces a crash - suspecting unprivileged access ARM instructions to be root cause. Any suggestions on avoiding such instructions in build is highly appreciated.Thanks!
ldrbt, ldrsht, ldrt
Nothing comes to mind, my apologies.
If you can locate the exact instruction failing on the 'bad' board, set a breakpoint at that same instruction on the 'good' board, and compare system states?
Were you able to rebuild your code with the latest compiler? Does that resolve the issue?
Apologies for the delay in response> Were you able to rebuild your code with the latest compiler? Does that resolve the issue?
Yes, the crash issue is resolved with the build from Compiler version 6.22.Thanks!