On 06/05/2021 09:27, Alex Coplan via Gcc-patches wrote:
Hi all,

The PR shows us attaching REG_CFA_ADJUST_CFA notes to stack pointer
adjustments emitted in cmse_nonsecure_call_inline_register_clear (when
-march=armv8.1-m.main). However, the stack pointer is not guaranteed to
be the CFA reg. If we're at -O0 or we have -fno-omit-frame-pointer, then
the frame pointer will be used as the CFA reg, and these notes on the sp
adjustments will lead to ICEs in dwarf2out_frame_debug_adjust_cfa.

This patch avoids emitting these notes if the current function has a
frame pointer.

Testing:
  * Bootstrapped and regtested on arm-linux-gnueabihf, no regressions.
  * Regtested an arm-eabi cross configured with --with-arch=armv8.1-m.main, no
    regressions.

OK for trunk and backports as appropriate?

Thanks,
Alex

gcc/ChangeLog:

        PR target/99725
        * config/arm/arm.c (cmse_nonsecure_call_inline_register_clear):
        Avoid emitting CFA adjusts on the sp if we have the fp.

gcc/testsuite/ChangeLog:

        PR target/99725
        * gcc.target/arm/cmse/pr99725.c: New test.


OK.

R.

Reply via email to