re PR tree-optimization/66794 (ICE at -O2 and -O3 on x86_64-linux-gnu)
authorRichard Biener <rguenther@suse.de>
Wed, 8 Jul 2015 11:47:42 +0000 (11:47 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 8 Jul 2015 11:47:42 +0000 (11:47 +0000)
2015-07-08  Richard Biener  <rguenther@suse.de>

PR tree-optimization/66794
* passes.c (execute_function_todo): Assert that post-dominators
are not computed.
* gimple-ssa-isolate-paths.c (gimple_ssa_isolate_erroneous_paths):
Free post-dominators.

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

From-SVN: r225545

gcc/ChangeLog
gcc/gimple-ssa-isolate-paths.c
gcc/passes.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr66794.c [new file with mode: 0644]

index a4c4b7686c72112e7eec6600cfd7f94a0e70700b..d3858096dea4136a77326e4db83355c45c0885b6 100644 (file)
@@ -1,3 +1,11 @@
+2015-07-08  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/66794
+       * passes.c (execute_function_todo): Assert that post-dominators
+       are not computed.
+       * gimple-ssa-isolate-paths.c (gimple_ssa_isolate_erroneous_paths):
+       Free post-dominators.
+
 2015-07-08  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * config/s390/s390.c (s390_init_frame_layout): Replace assertion
index 8b98d76e510648cfc98bf3501b1329711d2e39a6..b437182be6dd7179138aada6a5a40aafa6904158 100644 (file)
@@ -488,10 +488,10 @@ gimple_ssa_isolate_erroneous_paths (void)
   /* We scramble the CFG and loop structures a bit, clean up
      appropriately.  We really should incrementally update the
      loop structures, in theory it shouldn't be that hard.  */
+  free_dominance_info (CDI_POST_DOMINATORS);
   if (cfg_altered)
     {
       free_dominance_info (CDI_DOMINATORS);
-      free_dominance_info (CDI_POST_DOMINATORS);
       loops_state_set (LOOPS_NEED_FIXUP);
       return TODO_cleanup_cfg | TODO_update_ssa;
     }
index 6292fd263c4fd785e7efb85bf88bdbfeb700c13d..a2afb0aa614ebd10060866bcc7dbaae3ce554c00 100644 (file)
@@ -1929,6 +1929,7 @@ execute_function_todo (function *fn, void *data)
   if (flags & TODO_rebuild_cgraph_edges)
     cgraph_edge::rebuild_edges ();
 
+  gcc_assert (dom_info_state (fn, CDI_POST_DOMINATORS) == DOM_NONE);
   /* If we've seen errors do not bother running any verifiers.  */
   if (!seen_error ())
     {
index 7370e8fe3dbf3a4fc1d455c7d74a6f3e2f9bc0d4..7414562229f5a5a56ecb292351c3838d421d0bff 100644 (file)
@@ -1,3 +1,8 @@
+2015-07-08  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/66794
+       * gcc.dg/torture/pr66794.c: New testcase.
+
 2015-07-08  Marek Polacek  <polacek@redhat.com>
 
        PR c++/66748
diff --git a/gcc/testsuite/gcc.dg/torture/pr66794.c b/gcc/testsuite/gcc.dg/torture/pr66794.c
new file mode 100644 (file)
index 0000000..03eeec7
--- /dev/null
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-additional-options "-w" } */
+
+int a, *b, e;
+static int **c = &b;
+
+struct
+{
+  int f0;
+} d;
+
+int *
+fn1 ()
+{
+  int f, **g = &b;
+  e = a;
+  for (; a;)
+    for (; d.f0; d.f0++)
+      ;
+  *g = &f;
+  return *c;
+}