aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-05-17 15:13:18 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-05-17 15:13:18 -0400
commit50196afaca12b3d80a75fd1d5c4c7fca44e6ba75 (patch)
tree4107ef7dcfe50ca473620dd74df30d82ba84f043 /gcc
parenta89974a23e9eb2f44485b520bdb2b3bfd28eee51 (diff)
downloadgcc-50196afaca12b3d80a75fd1d5c4c7fca44e6ba75.zip
gcc-50196afaca12b3d80a75fd1d5c4c7fca44e6ba75.tar.gz
gcc-50196afaca12b3d80a75fd1d5c4c7fca44e6ba75.tar.bz2
(cse_insn): Don't record a SRC that's a MEM and the same as a
REG_EQUIV note if DEST is set more than once. From-SVN: r14074
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cse.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 260da29..1bae143 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -6477,6 +6477,21 @@ cse_insn (insn, in_libcall_block)
sets[i].src_in_memory = hash_arg_in_memory;
sets[i].src_in_struct = hash_arg_in_struct;
+ /* If SRC is a MEM, there is a REG_EQUIV note for SRC, and DEST is
+ a pseudo that is set more than once, do not record SRC. Using
+ SRC as a replacement for anything else will be incorrect in that
+ situation. Note that this usually occurs only for stack slots,
+ in which case all the RTL would be refering to SRC, so we don't
+ lose any optimization opportunities by not having SRC in the
+ hash table. */
+
+ if (GET_CODE (src) == MEM
+ && find_reg_note (insn, REG_EQUIV, src) != 0
+ && GET_CODE (dest) == REG
+ && REGNO (dest) >= FIRST_PSEUDO_REGISTER
+ && reg_n_sets[REGNO (dest)] != 1)
+ sets[i].src_volatile = 1;
+
#if 0
/* It is no longer clear why we used to do this, but it doesn't
appear to still be needed. So let's try without it since this