From 41b6ea681b5466b6bcbae045514f44792ef564a7 Mon Sep 17 00:00:00 2001 From: Jeffrey A Law Date: Fri, 15 Jan 1999 01:03:43 +0000 Subject: [PATCH] pa.c (hppa_expand_epilogue): Save and restore the static chain around the call to mcount. * pa.c (hppa_expand_epilogue): Save and restore the static chain around the call to mcount. From-SVN: r24672 --- gcc/ChangeLog | 3 +++ gcc/config/pa/pa.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 60cf86db9206..fe84462ef48f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,8 @@ Thu Jan 14 22:38:41 1999 Jeffrey A Law (law@cygnus.com) + * pa.c (hppa_expand_epilogue): Save and restore the static chain + around the call to mcount. + * h8300.h (ASM_OUTPUT_LABELREF): Use asm_fprintf, not fprintf. * stmt.c (expand_end_case): Use emit_cmp_and_jump_insns to avoid diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 371bf9a2ff1a..2bae75cc1d14 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -2834,6 +2834,8 @@ hppa_expand_prologue() hp_profile_label_rtx = gen_rtx_SYMBOL_REF (SImode, hp_profile_label_name); if (current_function_returns_struct) store_reg (STRUCT_VALUE_REGNUM, - 12 - offsetadj, basereg); + if (current_function_needs_context) + store_reg (STATIC_CHAIN_REGNUM, - 16 - offsetadj, basereg); for (i = 26, arg_offset = -36 - offsetadj; i >= 23; i--, arg_offset -= 4) if (regs_ever_live [i]) @@ -2858,6 +2860,8 @@ hppa_expand_prologue() if (current_function_returns_struct) load_reg (STRUCT_VALUE_REGNUM, -12 - offsetadj, basereg); + if (current_function_needs_context) + load_reg (STATIC_CHAIN_REGNUM, -16 - offsetadj, basereg); } /* Normal register save.