summaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-03 09:55:28 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-03 09:55:28 +0000
commitdfe5d46fa870d13d760caf829e4542201e847209 (patch)
tree9a007a73332492ade9946acd2795c2a31dd70a8b /gcc/reload1.c
parent951981be6a8fafa148b48ce33711a0fdb98b387a (diff)
downloadgcc-dfe5d46fa870d13d760caf829e4542201e847209.tar.gz
Revert my previous patch.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100536 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index 78484aa7536..0caa411fb4b 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -752,7 +752,7 @@ reload (rtx first, int global)
for equivalences. This is overly conservative as
we could find all sets of the destination pseudo
and remove them as they should be redundant. */
- if (memory_operand (x, VOIDmode))
+ if (memory_operand (x, VOIDmode) && ! MEM_READONLY_P (x))
{
/* Always unshare the equivalence, so we can
substitute into this insn without touching the
@@ -787,8 +787,14 @@ reload (rtx first, int global)
else
continue;
- reg_equiv_init[i]
- = gen_rtx_INSN_LIST (VOIDmode, insn, reg_equiv_init[i]);
+ /* If this register is being made equivalent to a MEM
+ and the MEM is not SET_SRC, the equivalencing insn
+ is one with the MEM as a SET_DEST and it occurs later.
+ So don't mark this insn now. */
+ if (!MEM_P (x)
+ || rtx_equal_p (SET_SRC (set), x))
+ reg_equiv_init[i]
+ = gen_rtx_INSN_LIST (VOIDmode, insn, reg_equiv_init[i]);
}
}
}
@@ -800,12 +806,9 @@ reload (rtx first, int global)
&& reg_equiv_memory_loc[REGNO (SET_SRC (set))]
&& rtx_equal_p (SET_DEST (set),
reg_equiv_memory_loc[REGNO (SET_SRC (set))]))
- /* Equivalences made this way only have one initializing insn.
- Previously, we may have set reg_equiv_init when encountering a
- SET of this pseudo; discard that insn since it does not set up
- an equivalence. */
reg_equiv_init[REGNO (SET_SRC (set))]
- = gen_rtx_INSN_LIST (VOIDmode, insn, NULL_RTX);
+ = gen_rtx_INSN_LIST (VOIDmode, insn,
+ reg_equiv_init[REGNO (SET_SRC (set))]);
if (INSN_P (insn))
scan_paradoxical_subregs (PATTERN (insn));