diff options
author | John David Anglin <danglin@gcc.gnu.org> | 2024-12-15 17:18:40 -0500 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2024-12-15 17:18:40 -0500 |
commit | 3e7ae868fa057a808448a5ab081d2ad30ad80bab (patch) | |
tree | d594924059cbf7647dbe3c39f279d937b02330e7 /gcc | |
parent | 9573fd7bc8ac5564be5e7fe45358298fc9733067 (diff) | |
download | gcc-3e7ae868fa057a808448a5ab081d2ad30ad80bab.zip gcc-3e7ae868fa057a808448a5ab081d2ad30ad80bab.tar.gz gcc-3e7ae868fa057a808448a5ab081d2ad30ad80bab.tar.bz2 |
hppa: Implement TARGET_FRAME_POINTER_REQUIRED
If a function receives nonlocal gotos, it needs to save the frame
pointer in the argument save area. This ensures that LRA sets
frame_pointer_needed when it saves arguments in the save area.
2024-12-15 John David Anglin <danglin@gcc.gnu.org>
gcc/ChangeLog:
PR target/118018
* config/pa/pa.cc (pa_frame_pointer_required): Declare and
implement.
(TARGET_FRAME_POINTER_REQUIRED): Define.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/pa/pa.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/config/pa/pa.cc b/gcc/config/pa/pa.cc index 99ed286..df2ec3c 100644 --- a/gcc/config/pa/pa.cc +++ b/gcc/config/pa/pa.cc @@ -209,6 +209,7 @@ static HOST_WIDE_INT pa_starting_frame_offset (void); static section* pa_elf_select_rtx_section(machine_mode, rtx, unsigned HOST_WIDE_INT) ATTRIBUTE_UNUSED; static void pa_atomic_assign_expand_fenv (tree *, tree *, tree *); static bool pa_use_lra_p (void); +static bool pa_frame_pointer_required (void); /* The following extra sections are only used for SOM. */ static GTY(()) section *som_readonly_data_section; @@ -393,6 +394,8 @@ static size_t n_deferred_plabels = 0; #define TARGET_DELEGITIMIZE_ADDRESS pa_delegitimize_address #undef TARGET_INTERNAL_ARG_POINTER #define TARGET_INTERNAL_ARG_POINTER pa_internal_arg_pointer +#undef TARGET_FRAME_POINTER_REQUIRED +#define TARGET_FRAME_POINTER_REQUIRED pa_frame_pointer_required #undef TARGET_CAN_ELIMINATE #define TARGET_CAN_ELIMINATE pa_can_eliminate #undef TARGET_CONDITIONAL_REGISTER_USAGE @@ -11334,4 +11337,17 @@ pa_use_lra_p () return pa_lra_p; } +/* Implement TARGET_FRAME_POINTER_REQUIRED. */ + +bool +pa_frame_pointer_required (void) +{ + /* If the function receives nonlocal gotos, it needs to save the frame + pointer in the argument save area. */ + if (cfun->has_nonlocal_label) + return true; + + return false; +} + #include "gt-pa.h" |