re PR rtl-optimization/6165 ([i686] stack frame freed too early)
authorRichard Henderson <rth@redhat.com>
Thu, 4 Apr 2002 22:48:16 +0000 (14:48 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Thu, 4 Apr 2002 22:48:16 +0000 (14:48 -0800)
        PR opt/6165
        * alias.c (true_dependence): Force (mem:blk (scratch)) to conflict.
        (write_dependence_p): Likewise.

From-SVN: r51882

gcc/ChangeLog
gcc/alias.c

index 23e407a49dece026697c647765d4c936b3950f60..d14b04c413f7977067cdeae3714cd569374a45a7 100644 (file)
@@ -1,3 +1,9 @@
+2002-04-04  Richard Henderson  <rth@redhat.com>
+
+       PR opt/6165
+       * alias.c (true_dependence): Force (mem:blk (scratch)) to conflict.
+       (write_dependence_p): Likewise.
+
 2002-04-04  Richard Henderson  <rth@redhat.com>
 
        * predict.c (estimate_bb_frequencies): Do frequency calculation
index 42d8e18210dfa868387de10dc9cce767a52a3e85..29da8ffafb3f38a0bb3c5c6a1279a6a14983f9a9 100644 (file)
@@ -2039,6 +2039,13 @@ true_dependence (mem, mem_mode, x, varies)
   if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
     return 1;
 
+  /* (mem:BLK (scratch)) is a special mechanism to conflict with everything.
+     This is used in epilogue deallocation functions.  */
+  if (GET_MODE (x) == BLKmode && GET_CODE (XEXP (x, 0)) == SCRATCH)
+    return 1;
+  if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH)
+    return 1;
+
   if (DIFFERENT_ALIAS_SETS_P (x, mem))
     return 0;
 
@@ -2173,6 +2180,13 @@ write_dependence_p (mem, x, writep)
   if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
     return 1;
 
+  /* (mem:BLK (scratch)) is a special mechanism to conflict with everything.
+     This is used in epilogue deallocation functions.  */
+  if (GET_MODE (x) == BLKmode && GET_CODE (XEXP (x, 0)) == SCRATCH)
+    return 1;
+  if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH)
+    return 1;
+
   if (DIFFERENT_ALIAS_SETS_P (x, mem))
     return 0;