re PR middle-end/52045 (ICE: in execute_todo, at passes.c:1748 with -O3 -ftracer...
authorRichard Guenther <rguenther@suse.de>
Mon, 30 Jan 2012 13:40:24 +0000 (13:40 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 30 Jan 2012 13:40:24 +0000 (13:40 +0000)
2012-01-30  Richard Guenther  <rguenther@suse.de>

PR tree-optimization/52045
* tree-optimize.c (execute_cleanup_cfg_post_optimizing): Update
SSA form if cfgcleanup did anything.

* gcc.dg/pr52045.c: New testcase.

From-SVN: r183722

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr52045.c [new file with mode: 0644]
gcc/tree-optimize.c

index 9414b24b0578cf85795ab29389665d776fab9eb2..e62c447b7b6034e6103f0af7ad4cbed78408e756 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-30  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/52045
+       * tree-optimize.c (execute_cleanup_cfg_post_optimizing): Update
+       SSA form if cfgcleanup did anything.
+
 2012-01-30  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/52045
index 77ad64db661aa323fd9516d23809dc5b55dfe82e..65a9a7a0f54b79c7261418c2a78fcec94b39ac4b 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-30  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/52045
+       * gcc.dg/pr52045.c: New testcase.
+
 2012-01-30  Greta Yorsh  <Greta.Yorsh@arm.com>
 
         * gcc.target/arm/di-longlong64-sync-withldrexd.c: Accept
diff --git a/gcc/testsuite/gcc.dg/pr52045.c b/gcc/testsuite/gcc.dg/pr52045.c
new file mode 100644 (file)
index 0000000..888ddb6
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -ftracer -fno-tree-ccp -fno-tree-copy-prop -fno-tree-dce" } */
+
+char *vx;
+char buf[20];
+
+void
+foo (void)
+{
+  vx = __builtin___stpcpy_chk (buf, vx ? "gh" : "e", sizeof(buf));
+}
index d242204b6719a6c95d61f43240baf380cf795fbb..3d18d20a003c36568fda6ad8df88db8cf45aa4fe 100644 (file)
@@ -157,7 +157,9 @@ struct gimple_opt_pass pass_all_early_optimizations =
 static unsigned int
 execute_cleanup_cfg_post_optimizing (void)
 {
-  cleanup_tree_cfg ();
+  unsigned int todo = 0;
+  if (cleanup_tree_cfg ())
+    todo |= TODO_update_ssa;
   maybe_remove_unreachable_handlers ();
   cleanup_dead_labels ();
   group_case_labels ();
@@ -190,7 +192,7 @@ execute_cleanup_cfg_post_optimizing (void)
            }
        }
     }
-  return 0;
+  return todo;
 }
 
 struct gimple_opt_pass pass_cleanup_cfg_post_optimizing =