summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-08 11:47:42 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2015-07-08 11:47:42 +0000
commit15381b1e12bc915062065930dd95564acc857838 (patch)
tree265fe7b6d7f9b0b2163e133b1cd957a8ff24da6b /gcc
parentb85ca4c869b6a4b03e24b89bca22cca1cb749727 (diff)
downloadgcc-15381b1e12bc915062065930dd95564acc857838.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225545 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gimple-ssa-isolate-paths.c2
-rw-r--r--gcc/passes.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr66794.c22
5 files changed, 37 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a4c4b7686c7..d3858096dea 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/gimple-ssa-isolate-paths.c b/gcc/gimple-ssa-isolate-paths.c
index 8b98d76e510..b437182be6d 100644
--- a/gcc/gimple-ssa-isolate-paths.c
+++ b/gcc/gimple-ssa-isolate-paths.c
@@ -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;
}
diff --git a/gcc/passes.c b/gcc/passes.c
index 6292fd263c4..a2afb0aa614 100644
--- a/gcc/passes.c
+++ b/gcc/passes.c
@@ -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 ())
{
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7370e8fe3db..7414562229f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..03eeec732bc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr66794.c
@@ -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;
+}