]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Fix .cfi_offset directive when push/pop in zcmp
authorLino Hsing-Yu Peng <linopeng@andestech.com>
Thu, 20 Feb 2025 09:09:22 +0000 (17:09 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Mon, 24 Feb 2025 08:04:32 +0000 (16:04 +0800)
commit4dcd3c7749734133f7f59509b1a118f3a13de4ee
treec8faba7570b3cfbecf9bf27542202500b079abe4
parent7cfb2c8839c4ccaaf7d66f446c4c0d040b710f18
RISC-V: Fix .cfi_offset directive when push/pop in zcmp

The incorrect cfi directive info breaks stack unwind in try/catch/cxa.

Before patch:
  cm.push {ra, s0-s2}, -16
  .cfi_offset 1, -12
  .cfi_offset 8, -8
  .cfi_offset 18, -4

After patch:
  cm.push {ra, s0-s2}, -16
  .cfi_offset 1, -16
  .cfi_offset 8, -12
  .cfi_offset 9, -8
  .cfi_offset 18, -4

gcc/ChangeLog:

* config/riscv/riscv.cc: Set multi push regs bits.

gcc/testsuite/ChangeLog:
* gcc.target/riscv/zcmp_push_gpr.c: New test.
gcc/config/riscv/riscv.cc
gcc/testsuite/gcc.target/riscv/zcmp_push_gpr.c [new file with mode: 0644]