]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix queueing-related bugs
authorBernd Schmidt <bernds@redhat.com>
Thu, 17 May 2001 17:01:06 +0000 (17:01 +0000)
committerBernd Schmidt <bernds@gcc.gnu.org>
Thu, 17 May 2001 17:01:06 +0000 (17:01 +0000)
From-SVN: r42204

gcc/ChangeLog
gcc/expr.c

index 02db4d9bc22321accac0bf6d0212420022c47945..d77d48ae5cfb49dfc22b8ba01457435a04835036 100644 (file)
@@ -3,6 +3,11 @@
        * function.c: Small formatting change to prevent compilation errors
        on broken hpux systems.
 
+       * expr.c (protect_from_queue): Protect against subsequent calls to
+       emit_queue.
+       (expand_expr, case ADDR_EXPR): Prevent protect_from_queue from being
+       too clever.
+
 2001-04-06  Bernd Schmidt  <bernds@redhat.com>
 
        2000-10-17  Franz Sirl  <Franz.Sirl-kernel@lauterbach.com>
index 9ccab891aeb8d97280de200e99ef26c8994a0c4e..ef16c762f98769c4d494553c7de363f35dff2ae9 100644 (file)
@@ -450,6 +450,9 @@ protect_from_queue (x, modify)
                                QUEUED_INSN (y));
              return temp;
            }
+         /* Copy the address into a pseudo, so that the returned value
+            remains correct across calls to emit_queue.  */
+         XEXP (new, 0) = copy_to_reg (XEXP (new, 0));
          return new;
        }
       /* Otherwise, recursively protect the subexpressions of all
@@ -476,9 +479,11 @@ protect_from_queue (x, modify)
        }
       return x;
     }
-  /* If the increment has not happened, use the variable itself.  */
+  /* If the increment has not happened, use the variable itself.  Copy it
+     into a new pseudo so that the value remains correct across calls to
+     emit_queue.  */
   if (QUEUED_INSN (x) == 0)
-    return QUEUED_VAR (x);
+    return copy_to_reg (QUEUED_VAR (x));
   /* If the increment has happened and a pre-increment copy exists,
      use that copy.  */
   if (QUEUED_COPY (x) != 0)
@@ -8077,7 +8082,9 @@ expand_expr (exp, target, tmode, modifier)
          if (ignore)
            return op0;
 
-         op0 = protect_from_queue (op0, 0);
+         /* Pass 1 for MODIFY, so that protect_from_queue doesn't get
+            clever and returns a REG when given a MEM.  */
+         op0 = protect_from_queue (op0, 1);
 
          /* We would like the object in memory.  If it is a constant,
             we can have it be statically allocated into memory.  For