diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2003-03-26 19:21:08 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@gcc.gnu.org> | 2003-03-26 19:21:08 +0000 |
commit | 6f84708ae065be56867aa161a5e9d07a328a8782 (patch) | |
tree | ba82244bbf52e3fbe6979b38937df17c5318598c | |
parent | 5e8006fa728c84b2075a8ff3540d2528846e862e (diff) | |
download | gcc-6f84708ae065be56867aa161a5e9d07a328a8782.zip gcc-6f84708ae065be56867aa161a5e9d07a328a8782.tar.gz gcc-6f84708ae065be56867aa161a5e9d07a328a8782.tar.bz2 |
s390.c (s390_optimize_prolog): Do not save/restore registers used for global asm variables.
* config/s390/s390.c (s390_optimize_prolog): Do not save/restore
registers used for global asm variables.
(s390_frame_info, s390_arg_frame_offset): Likewise.
(s390_emit_prologue, s390_emit_epilogue): Likewise.
From-SVN: r64902
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 33 |
2 files changed, 30 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7b1c446..af1a27d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-03-26 Ulrich Weigand <uweigand@de.ibm.com> + + * config/s390/s390.c (s390_optimize_prolog): Do not save/restore + registers used for global asm variables. + (s390_frame_info, s390_arg_frame_offset): Likewise. + (s390_emit_prologue, s390_emit_epilogue): Likewise. + 2003-03-26 Vladimir Makarov <vmakarov@redhat.com> * config/rs6000/8540.md: New file. diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 0e5d0f6..befaf8f 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -4779,11 +4779,21 @@ s390_optimize_prolog (temp_regno) for (i = 6; i < 16; i++) if (regs_ever_live[i]) - break; + if (!global_regs[i] + || i == STACK_POINTER_REGNUM + || i == RETURN_REGNUM + || i == BASE_REGISTER + || (flag_pic && i == (int)PIC_OFFSET_TABLE_REGNUM)) + break; for (j = 15; j > i; j--) if (regs_ever_live[j]) - break; + if (!global_regs[j] + || j == STACK_POINTER_REGNUM + || j == RETURN_REGNUM + || j == BASE_REGISTER + || (flag_pic && j == (int)PIC_OFFSET_TABLE_REGNUM)) + break; if (i == 16) { @@ -5077,7 +5087,7 @@ s390_frame_info () cfun->machine->save_fprs_p = 0; if (TARGET_64BIT) for (i = 24; i < 32; i++) - if (regs_ever_live[i]) + if (regs_ever_live[i] && !global_regs[i]) { cfun->machine->save_fprs_p = 1; break; @@ -5101,8 +5111,11 @@ s390_frame_info () prolog/epilog code is modified again. */ for (i = 0; i < 16; i++) - gprs_ever_live[i] = regs_ever_live[i]; + gprs_ever_live[i] = regs_ever_live[i] && !global_regs[i]; + if (flag_pic) + gprs_ever_live[PIC_OFFSET_TABLE_REGNUM] = + regs_ever_live[PIC_OFFSET_TABLE_REGNUM]; gprs_ever_live[BASE_REGISTER] = 1; gprs_ever_live[RETURN_REGNUM] = 1; gprs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0; @@ -5139,7 +5152,7 @@ s390_arg_frame_offset () save_fprs_p = 0; if (TARGET_64BIT) for (i = 24; i < 32; i++) - if (regs_ever_live[i]) + if (regs_ever_live[i] && !global_regs[i]) { save_fprs_p = 1; break; @@ -5368,12 +5381,12 @@ s390_emit_prologue () if (!TARGET_64BIT) { /* Save fpr 4 and 6. */ - if (regs_ever_live[18]) + if (regs_ever_live[18] && !global_regs[18]) { insn = save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 16, 18); RTX_FRAME_RELATED_P (insn) = 1; } - if (regs_ever_live[19]) + if (regs_ever_live[19] && !global_regs[19]) { insn = save_fpr (stack_pointer_rtx, STACK_POINTER_OFFSET - 8, 19); RTX_FRAME_RELATED_P (insn) = 1; @@ -5425,7 +5438,7 @@ s390_emit_prologue () insn = emit_insn (gen_add2_insn (temp_reg, GEN_INT(-64))); for (i = 24; i < 32; i++) - if (regs_ever_live[i]) + if (regs_ever_live[i] && !global_regs[i]) { rtx addr = plus_constant (stack_pointer_rtx, cfun->machine->frame_size - 64 + (i-24)*8); @@ -5523,14 +5536,14 @@ s390_emit_epilogue () } else { - if (regs_ever_live[18]) + if (regs_ever_live[18] && !global_regs[18]) { if (area_bottom > STACK_POINTER_OFFSET - 16) area_bottom = STACK_POINTER_OFFSET - 16; if (area_top < STACK_POINTER_OFFSET - 8) area_top = STACK_POINTER_OFFSET - 8; } - if (regs_ever_live[19]) + if (regs_ever_live[19] && !global_regs[19]) { if (area_bottom > STACK_POINTER_OFFSET - 8) area_bottom = STACK_POINTER_OFFSET - 8; |