cse.c (cse_insn): When SETting (MEM (ADDRESSOF (X))) to Y...

* cse.c (cse_insn): When SETting (MEM (ADDRESSOF (X))) to Y,
        don't claim that the former is equivalent to the latter.

From-SVN: r20935
This commit is contained in:
Mark Mitchell 1998-07-05 23:33:36 +00:00 committed by Jeff Law
parent adc05e6ce6
commit 9de2c71a47
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,8 @@
Mon Jul 6 00:28:43 1998 Mark Mitchell <mark@markmitchell.com>
* cse.c (cse_insn): When SETting (MEM (ADDRESSOF (X))) to Y,
don't claim that the former is equivalent to the latter.
Sun Jul 5 23:58:19 1998 Jeffrey A Law (law@cygnus.com)
* combine.c (simplify_comparison): Do not commute a AND into

View File

@ -7405,6 +7405,7 @@ cse_insn (insn, in_libcall_block)
if (sets[i].rtl)
{
register rtx dest = SET_DEST (sets[i].rtl);
rtx inner_dest = sets[i].inner_dest;
register struct table_elt *elt;
/* Don't record value if we are not supposed to risk allocating
@ -7453,8 +7454,18 @@ cse_insn (insn, in_libcall_block)
sets[i].dest_hash = HASH (dest, GET_MODE (dest));
}
elt = insert (dest, sets[i].src_elt,
sets[i].dest_hash, GET_MODE (dest));
if (GET_CODE (inner_dest) == MEM
&& GET_CODE (XEXP (inner_dest, 0)) == ADDRESSOF)
/* Given (SET (MEM (ADDRESSOF (X))) Y) we don't want to say
that (MEM (ADDRESSOF (X))) is equivalent to Y.
Consider the case in which the address of the MEM is
passed to a function, which alters the MEM. Then, if we
later use Y instead of the MEM we'll miss the update. */
elt = insert (dest, 0, sets[i].dest_hash, GET_MODE (dest));
else
elt = insert (dest, sets[i].src_elt,
sets[i].dest_hash, GET_MODE (dest));
elt->in_memory = (GET_CODE (sets[i].inner_dest) == MEM
&& (! RTX_UNCHANGING_P (sets[i].inner_dest)
|| FIXED_BASE_PLUS_P (XEXP (sets[i].inner_dest,