re PR tree-optimization/14470 ([tree-ssa] trouble with post-increment)
authorEric Botcazou <ebotcazou@libertysurf.fr>
Sat, 13 Mar 2004 18:16:14 +0000 (19:16 +0100)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sat, 13 Mar 2004 18:16:14 +0000 (18:16 +0000)
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: r79452

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20040313-1.c [new file with mode: 0644]

index dcba2c1972a4619ff3612e5ed5af3c408e1112d5..8b0b58ef3c2f98406235cde3edf3c3d82a8b20ed 100644 (file)
@@ -1,3 +1,10 @@
+2004-03-13  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-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/14533
index d5267505c6b506557ae7fe384829a75e8300d900..46140bbf3e4a06aadc6ff18ad5e3b873fda8a9b3 100644 (file)
@@ -4245,7 +4245,9 @@ store_expr (tree exp, rtx target, int 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 2d03db8ff5fbbb6d2a6998cd686e88876b966014..7a113afdc88ee2081ff90b814800d2fd58270877 100644 (file)
@@ -1,3 +1,7 @@
+2004-03-13  Eric Botcazou  <ebotcazou@libertysurf.fr>
+
+       * gcc.c-torture/execute/20040313-1.c: New test.
+
 2004-03-13  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/14533
@@ -21388,3 +21392,4 @@ rlsruhe.de>
        correspond to c-torture 1.11.
 
        * New file.
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/20040313-1.c b/gcc/testsuite/gcc.c-torture/execute/20040313-1.c
new file mode 100644 (file)
index 0000000..c05fe73
--- /dev/null
@@ -0,0 +1,17 @@
+/* PR middle-end/14470 */
+/* Origin: Lodewijk Voge <lvoge@cs.vu.nl> */
+
+extern void abort(void);
+
+int main()
+{
+  int t[1025] = { 1024 }, d;
+
+  d = 0;
+  d = t[d]++;
+  if (t[0] != 1025)
+    abort();
+  if (d != 1024)
+    abort();
+  return 0;
+}