]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR tree-optimization/50767 (ICE: in refs_may_alias_p_1, at tree-ssa-alias.c:1004...
authorRichard Guenther <rguenther@suse.de>
Tue, 18 Oct 2011 11:44:15 +0000 (11:44 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 18 Oct 2011 11:44:15 +0000 (11:44 +0000)
2011-10-18  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/50767
* tree-ssa-pre.c (create_expression_by_pieces): Update the
folded statement.

* gcc.dg/torture/pr50767.c: New testcase.

From-SVN: r180134

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr50767.c [new file with mode: 0644]
gcc/tree-ssa-pre.c

index 2968fb0de5e1c7727b63d35b02d125f93cd563a0..d026022fadb150bbddf0eb1fe79820dd95449236 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-18  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/50767
+       * tree-ssa-pre.c (create_expression_by_pieces): Update the
+       folded statement.
+
 2011-10-18  Julian Brown  <julian@codesourcery.com>
 
        * config/arm/arm.c (arm_block_move_unaligned_straight)
index 3216bfcb47a5eb3f451e840bf71a9eb1e0fc0566..411f63e8c43dfedd0456d78c3af4579ccc663c16 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-18  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/50767
+       * gcc.dg/torture/pr50767.c: New testcase.
+
 2011-10-18  Julian Brown  <julian@codesourcery.com>
 
        * lib/target-supports.exp (check_effective_target_arm_unaligned): New.
diff --git a/gcc/testsuite/gcc.dg/torture/pr50767.c b/gcc/testsuite/gcc.dg/torture/pr50767.c
new file mode 100644 (file)
index 0000000..96ab72e
--- /dev/null
@@ -0,0 +1,21 @@
+/* { dg-do compile } */
+/* { dg-options "-fno-tree-copy-prop -fno-tree-dominator-opts" } */
+
+struct S
+{
+  struct S *s;
+};
+
+static struct S *ss;
+struct S *s;
+
+void bar(void);
+
+void foo(void)
+{
+  for (;;)
+    {
+      s->s = ss;
+      bar ();
+    }
+}
index a7f6cee35d8fe41f91d941995b7c30fc55f3c055..60ae35cef73164e8969d96efc6a48fa6cf721647 100644 (file)
@@ -3188,7 +3188,8 @@ create_expression_by_pieces (basic_block block, pre_expr expr,
 
   /* Fold the last statement.  */
   gsi = gsi_last (*stmts);
-  fold_stmt_inplace (&gsi);
+  if (fold_stmt_inplace (&gsi))
+    update_stmt (gsi_stmt (gsi));
 
   /* Add a value number to the temporary.
      The value may already exist in either NEW_SETS, or AVAIL_OUT, because