diff options
author | Richard Henderson <rth@cygnus.com> | 2000-10-24 16:01:11 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2000-10-24 16:01:11 -0700 |
commit | c0fc376bcfaaf42823c07e5cd8420343fd56b370 (patch) | |
tree | ec392ba1631d9fe432a9fde0ebde287cfbd3a679 /gcc | |
parent | d7836e38b773cb5aaebc661e57704def6a17c5b5 (diff) | |
download | gcc-c0fc376bcfaaf42823c07e5cd8420343fd56b370.zip gcc-c0fc376bcfaaf42823c07e5cd8420343fd56b370.tar.gz gcc-c0fc376bcfaaf42823c07e5cd8420343fd56b370.tar.bz2 |
rtlanal.c (rtx_unstable_p, [...]): Don't consider pic register stable if PIC_OFFSET_TABLE_REG_CALL_CLOBBERED.
* rtlanal.c (rtx_unstable_p, rtx_varies_p): Don't consider pic
register stable if PIC_OFFSET_TABLE_REG_CALL_CLOBBERED.
From-SVN: r37040
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/rtlanal.c | 27 |
2 files changed, 27 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9ab283a..e4c278b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-10-24 Richard Henderson <rth@cygnus.com> + + * rtlanal.c (rtx_unstable_p, rtx_varies_p): Don't consider pic + register stable if PIC_OFFSET_TABLE_REG_CALL_CLOBBERED. + 2000-10-24 Aldy Hernandez <aldyh@redhat.com> * gcse.c (cprop_insn): do not propagate constants into jump_insn diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 52a430b..88b49fe 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -70,9 +70,17 @@ rtx_unstable_p (x) case REG: /* As in rtx_varies_p, we have to use the actual rtx, not reg number. */ - return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx - || x == arg_pointer_rtx || x == pic_offset_table_rtx - || RTX_UNCHANGING_P (x)); + if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx + || x == arg_pointer_rtx || RTX_UNCHANGING_P (x)) + return 0; +#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED + /* ??? When call-clobbered, the value is stable modulo the restore + that must happen after a call. This currently screws up local-alloc + into believing that the restore is not needed. */ + if (x == pic_offset_table_rtx) + return 0; +#endif + return 1; case ASM_OPERANDS: if (MEM_VOLATILE_P (x)) @@ -135,8 +143,17 @@ rtx_varies_p (x) and arg pointers and not just the register number in case we have eliminated the frame and/or arg pointer and are using it for pseudos. */ - return ! (x == frame_pointer_rtx || x == hard_frame_pointer_rtx - || x == arg_pointer_rtx || x == pic_offset_table_rtx); + if (x == frame_pointer_rtx || x == hard_frame_pointer_rtx + || x == arg_pointer_rtx) + return 0; +#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED + /* ??? When call-clobbered, the value is stable modulo the restore + that must happen after a call. This currently screws up local-alloc + into believing that the restore is not needed. */ + if (x == pic_offset_table_rtx) + return 0; +#endif + return 1; case LO_SUM: /* The operand 0 of a LO_SUM is considered constant |