Hello
We experience a problem with a call to the memcmp function.
We are using MCUXpresso 11.4.1 and the Redlib library.
Under certain circumstances, the memcmp function returns the wrong result. We debugged by looking at the disassembly, and experienced unexpected behaviour there.
It seems that in the failing cases, the subs r2, #4 instruction is not executed.
Following are screenshots from the debug session, first for the successful case, and then for the failing case.
Successful case
Situation before the SUBS r2, #4


Situation after SUBS r2, #4


This is as expected, r2 has been decremented by 4.
Failing case
Situation before the SUBS r2, #4


Situation after SUBS r2, #4


This is not expected. r2 stays 0xC, and this seems to be the reason why the memcmp fails.
What could lead to such a failure?
Thanks in advance and regards,
Daniel