[Committed,0/3] IBM zSystems: Add -mpreserve-args option

Message ID 20230201080445.10135-1-krebbel@linux.ibm.com
Headers
Series IBM zSystems: Add -mpreserve-args option |

Message

Andreas Krebbel Feb. 1, 2023, 8:04 a.m. UTC
  This adds support for preserving the content of parameter registers to
the stack and emit CFI for it. This useful for applications which want
to implement their own stack unwinding and need access to function
arguments without having to rely on debug information.

With the -mpreserve-args option GPRs and FPRs are save to the stack
slots which are reserved for stdargs in the register save area.

The introduction of REG_CFA_NORESTORE is a common code change which
has been approved last year already.

Bootstrapped and regtested on s390x. Committed to mainline. 

Andreas Krebbel (3):
  New reg note REG_CFA_NORESTORE
  IBM zSystems: Make stack_tie to work with hard frame pointer
  IBM zSystems: Save argument registers to the stack -mpreserve-args

 gcc/config/s390/s390.cc                       | 271 ++++++++++++------
 gcc/config/s390/s390.md                       |   5 +-
 gcc/config/s390/s390.opt                      |   4 +
 gcc/dwarf2cfi.cc                              |  15 +-
 gcc/reg-notes.def                             |   5 +
 .../gcc.target/s390/preserve-args-1.c         |  17 ++
 .../gcc.target/s390/preserve-args-2.c         |  19 ++
 .../gcc.target/s390/preserve-args-3.c         |  19 ++
 8 files changed, 265 insertions(+), 90 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/s390/preserve-args-1.c
 create mode 100644 gcc/testsuite/gcc.target/s390/preserve-args-2.c
 create mode 100644 gcc/testsuite/gcc.target/s390/preserve-args-3.c