aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2001-03-12 19:09:57 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2001-03-12 14:09:57 -0500
commite8ea2809d0dd85f1a235ba868897da51b79fca64 (patch)
tree01a1f60a4828fbe8cab90871760e677dc8ecc6fa /gcc
parent89c9653e9a01c49fbd758547482629a728fda3a0 (diff)
downloadgcc-e8ea2809d0dd85f1a235ba868897da51b79fca64.zip
gcc-e8ea2809d0dd85f1a235ba868897da51b79fca64.tar.gz
gcc-e8ea2809d0dd85f1a235ba868897da51b79fca64.tar.bz2
flow.c (insn_dead_p): Don't consider two memrefs equivalent unless anti_dependence says they are.
* flow.c (insn_dead_p): Don't consider two memrefs equivalent unless anti_dependence says they are. * alias.c (objects_must_conflict): If neither has a type specified, they must conflict. From-SVN: r40420
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/alias.c6
-rw-r--r--gcc/flow.c37
3 files changed, 32 insertions, 18 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ebbcd04..ea73863 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+Mon Mar 12 14:05:32 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * flow.c (insn_dead_p): Don't consider two memrefs equivalent
+ unless anti_dependence says they are.
+ * alias.c (objects_must_conflict): If neither has a type specified,
+ they must conflict.
+
2001-03-12 Neil Booth <neil@daikokuya.demon.co.uk>
David Billinghurst <David.Billinghurst@riotinto.com>
diff --git a/gcc/alias.c b/gcc/alias.c
index 85bce38..6d794ba 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -309,6 +309,12 @@ int
objects_must_conflict_p (t1, t2)
tree t1, t2;
{
+ /* If neither has a type specified, we don't know if they'll conflict
+ because we may be using them to store objects of various types, for
+ example the argument and local variables areas of inlined functions. */
+ if (t1 == 0 && t1 == 0)
+ return 0;
+
/* If one or the other has readonly fields or is readonly,
then they may not conflict. */
if ((t1 != 0 && readonly_fields_p (t1))
diff --git a/gcc/flow.c b/gcc/flow.c
index 82e9017..8197655 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -4420,27 +4420,28 @@ insn_dead_p (pbi, x, call_ok, notes)
/* Walk the set of memory locations we are currently tracking
and see if one is an identical match to this memory location.
If so, this memory write is dead (remember, we're walking
- backwards from the end of the block to the start). */
- temp = pbi->mem_set_list;
- while (temp)
- {
- rtx mem = XEXP (temp, 0);
+ backwards from the end of the block to the start). Since
+ rtx_equal_p does not check the alias set or flags, we also
+ must have the potential for them to conflict (anti_dependence). */
+ for (temp = pbi->mem_set_list; temp != 0; temp = XEXP (temp, 1))
+ if (anti_dependence (r, XEXP (temp, 0)))
+ {
+ rtx mem = XEXP (temp, 0);
- if (rtx_equal_p (mem, r))
- return 1;
+ if (rtx_equal_p (mem, r))
+ return 1;
#ifdef AUTO_INC_DEC
- /* Check if memory reference matches an auto increment. Only
- post increment/decrement or modify are valid. */
- if (GET_MODE (mem) == GET_MODE (r)
- && (GET_CODE (XEXP (mem, 0)) == POST_DEC
- || GET_CODE (XEXP (mem, 0)) == POST_INC
- || GET_CODE (XEXP (mem, 0)) == POST_MODIFY)
- && GET_MODE (XEXP (mem, 0)) == GET_MODE (r)
- && rtx_equal_p (XEXP (XEXP (mem, 0), 0), XEXP (r, 0)))
- return 1;
+ /* Check if memory reference matches an auto increment. Only
+ post increment/decrement or modify are valid. */
+ if (GET_MODE (mem) == GET_MODE (r)
+ && (GET_CODE (XEXP (mem, 0)) == POST_DEC
+ || GET_CODE (XEXP (mem, 0)) == POST_INC
+ || GET_CODE (XEXP (mem, 0)) == POST_MODIFY)
+ && GET_MODE (XEXP (mem, 0)) == GET_MODE (r)
+ && rtx_equal_p (XEXP (XEXP (mem, 0), 0), XEXP (r, 0)))
+ return 1;
#endif
- temp = XEXP (temp, 1);
- }
+ }
}
else
{