[PATCH,V3 4/4] gas: sframe: handle .cfi_same_value

Jens Remus jremus@linux.ibm.com
Wed May 21 15:51:13 GMT 2025


Hello Indu!

On 18.05.2025 09:52, Indu Bhagat wrote:
> Fix PR gas/32953 - sframe: incorrect handling of .cfi_same_value in gas
> 
> As per documentation, .cfi_same_value indicates that the current value
> of register is the same like in the previous frame, i.e. no restoration
> needed.
> 
> In some cases, SFrame has no means to encode this information.  Warn and
> skip generating the SFrame FDE in those cases.
> 
> gas/
> 	* gen-sframe.c (sframe_xlate_do_same_value): New definition.
> 	(sframe_do_cfi_insn): Handle DW_CFA_same_value.
> gas/testsuite/
> 	* gas/cfi-sframe/cfi-sframe.exp: Add new tests.
> 	* gas/cfi-sframe/cfi-sframe-common-11.d: New test.
> 	* gas/cfi-sframe/cfi-sframe-common-11.s: New test.
> 
> ---

LGTM!  Thank you for taking my review feedback into account!

> [Changes in V3]
>  - It is only necessary to check for the appropriate substring in the
>    warning meesage.  "no SFrame FDE emitted" need not necessarily be
>    checked.
>  - Handle DW_CFA_same_value <SP> the same as DW_CFA_restore <SP> : skip
>    processing the directive.
>  - Handle DW_CFA_same_value <RA> the same as DW_CFA_restore <RA> : skip
>    processing the directive if !sframe_ra_tracking_p ().
> [End of changes in V3]
> 
> [Changes in V2]
>  - Update the implementation.  Skip generating FDE only those cases when
>    the representation is not supported in SFrame.
>  - Correct the name of the test.  Updated the test
>    cfi-sframe-x86_64-empty-5.s to be for REG_RA instead of the earlier
>    REG_FP.
>  - Reword the warning text.
> [End of changes in V2]
> ---
>  gas/gen-sframe.c                              | 61 ++++++++++++++++++-
>  .../gas/cfi-sframe/cfi-sframe-common-11.d     | 22 +++++++
>  .../gas/cfi-sframe/cfi-sframe-common-11.s     | 12 ++++
>  gas/testsuite/gas/cfi-sframe/cfi-sframe.exp   |  1 +
>  4 files changed, 93 insertions(+), 3 deletions(-)
>  create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-11.d
>  create mode 100644 gas/testsuite/gas/cfi-sframe/cfi-sframe-common-11.s

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
+49-7031-16-1128 Office
jremus@de.ibm.com

IBM

IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Böblingen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/



More information about the Binutils mailing list