]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/14470 ([tree-ssa] trouble with post-increment)
authorGabriel Dos Reis <gdr@integrable-solutions.net>
Sat, 13 Mar 2004 03:03:38 +0000 (03:03 +0000)
committerGabriel Dos Reis <gdr@gcc.gnu.org>
Sat, 13 Mar 2004 03:03:38 +0000 (03:03 +0000)
Backport:
2004-03-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
        PR middle-end/14470
* expr.c (store_expr): Call emit_queue before generating the move
from the temporary to the original target.  Protect the temporary
from emit_queue.

From-SVN: r79429

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/gcc.c-torture/execute/20040309-1.c

index 26fda29fb639ed64642367985f2ddc9e2db5e53b..6bd8b81374efb96c05f0b9ad6e7d0e99d9f677d1 100644 (file)
@@ -1,3 +1,12 @@
+2004-03-12  Gabriel Dos Reis  <gdr@integrable-solutions.net>
+
+       Backport:
+       2004-03-09  Eric Botcazou  <ebotcazou@libertysurf.fr>
+        PR middle-end/14470
+       * expr.c (store_expr): Call emit_queue before generating the move
+       from the temporary to the original target.  Protect the temporary
+       from emit_queue.        
+
 2004-03-10  James E Wilson  <wilson@specifixinc.com>
 
        PR target/13877
index c239ac96855dc6bdcb674e8cac6b234c717109e0..f3a6f1ea88babb1309a15e594e3ded3583cefa74 100644 (file)
@@ -4552,7 +4552,9 @@ store_expr (exp, target, want_value)
         bit-initialized.  */
       && expr_size (exp) != const0_rtx)
     {
+      emit_queue ();
       target = protect_from_queue (target, 1);
+      temp = protect_from_queue (temp, 0);
       if (GET_MODE (temp) != GET_MODE (target)
          && GET_MODE (temp) != VOIDmode)
        {
index 49fa79560c60b4ca545f8575d64b527d379b9216..d52532d6b444ea120b5c98413629d553055b255e 100644 (file)
@@ -1,24 +1,16 @@
-extern void abort ();
+/* PR middle-end/14470 */
+/* Origin: Lodewijk Voge <lvoge@cs.vu.nl> */
 
-int foo(unsigned short x)
-{
-  unsigned short y;
-  y = x > 32767 ? x - 32768 : 0;
-  return y;
-}
+extern void abort(void);
 
 int main()
 {
-  if (foo (0) != 0)
-    abort ();
-  if (foo (32767) != 0)
-    abort ();
-  if (foo (32768) != 0)
-    abort ();
-  if (foo (32769) != 1)
-    abort ();
-  if (foo (65535) != 32767)
-    abort ();
+  int t[1025] = { 1024 }, d;
+
+  d = 0;
+  d = t[d]++;
+  if (t[0] != 1025)
+    abort();
   return 0;
 }