aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-10-02 14:10:47 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-10-02 14:10:47 -0400
commitd81481d3d95364ece0e95fb8d0373bef2e55f50d (patch)
tree958c1eba283b70add246dda8245e404336270826 /gcc
parent1ddb342ad7b20c56b38ad4319f937d2d62c95841 (diff)
downloadgcc-d81481d3d95364ece0e95fb8d0373bef2e55f50d.zip
gcc-d81481d3d95364ece0e95fb8d0373bef2e55f50d.tar.gz
gcc-d81481d3d95364ece0e95fb8d0373bef2e55f50d.tar.bz2
(can_combine_p): Allow an insn with a REG_EQUIV note that reads memory
to be moved past an insn that writes memory. From-SVN: r5562
Diffstat (limited to 'gcc')
-rw-r--r--gcc/combine.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 45d572a..c502656 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -855,10 +855,14 @@ can_combine_p (insn, i3, pred, succ, pdest, psrc)
If the insns are adjacent, a use can't cross a set even though we
think it might (this can happen for a sequence of insns each setting
the same destination; reg_last_set of that register might point to
- a NOTE). Also, don't move a volatile asm or UNSPEC_VOLATILE across
- any other insns. */
+ a NOTE). If INSN has a REG_EQUIV note, the register is always
+ equivalent to the memory so the substitution is valid even if there
+ are intervening stores. Also, don't move a volatile asm or
+ UNSPEC_VOLATILE across any other insns. */
|| (! all_adjacent
- && (use_crosses_set_p (src, INSN_CUID (insn))
+ && (((GET_CODE (src) != MEM
+ || ! find_reg_note (insn, REG_EQUIV, src))
+ && use_crosses_set_p (src, INSN_CUID (insn)))
|| (GET_CODE (src) == ASM_OPERANDS && MEM_VOLATILE_P (src))
|| GET_CODE (src) == UNSPEC_VOLATILE))
/* If there is a REG_NO_CONFLICT note for DEST in I3 or SUCC, we get