+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
 
   /* 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;
     }
 
   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 ())
     {
 
+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
 
--- /dev/null
+/* { 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;
+}