]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: sframe: fix PR gas/33170
authorIndu Bhagat <indu.bhagat@oracle.com>
Thu, 17 Jul 2025 22:17:36 +0000 (15:17 -0700)
committerIndu Bhagat <indu.bhagat@oracle.com>
Wed, 23 Jul 2025 07:11:47 +0000 (00:11 -0700)
commit83eeaf917873a550656faf9a38cd14e0f4c521b1
treeb5cb73c9fe7d1efea926bad564a2e72ceaf6f42f
parent58fe9ce1d6c3a67e47d192ce153cc1edf2884a87
gas: sframe: fix PR gas/33170

SFrame generation code assumes that since DW_CFA_restore means
restoration of the state of the register to the one at the beginning of
the function, there must be a state to restore to (hence the gas_assert
(cie_fre)).

This assumption needs adjustment.  DW_CFA_restore may be present in the
very beginning of a (e.g., cold) function, with no initialized state for
SFrame functions to restore to.

gas/
PR gas/33170
* gas/gen-sframe.c (sframe_xlate_do_restore): Use current FRE if
CIE FRE is not yet setup.
gas/testsuite/
PR gas/33170
* gas/cfi-sframe/cfi-sframe.exp: New test.
* gas/cfi-sframe/cfi-sframe-x86_64-pr33170.d: New test.
* gas/cfi-sframe/cfi-sframe-x86_64-pr33170.s: New test.
gas/gen-sframe.c
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-pr33170.d [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe-x86_64-pr33170.s [new file with mode: 0644]
gas/testsuite/gas/cfi-sframe/cfi-sframe.exp