diff options
author | Richard Biener <rguenther@suse.de> | 2013-04-29 09:09:08 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2013-04-29 09:09:08 +0000 |
commit | ea78906a44deed40a23a5ef2362310e4d116c798 (patch) | |
tree | 05821b7b1c508f54cc00d84ecea7b4e4d56626c1 | |
parent | 96cc0ef46bd4bfa5585a0ab900e76b11245e11b7 (diff) | |
download | gcc-ea78906a44deed40a23a5ef2362310e4d116c798.zip gcc-ea78906a44deed40a23a5ef2362310e4d116c798.tar.gz gcc-ea78906a44deed40a23a5ef2362310e4d116c798.tar.bz2 |
re PR tree-optimization/57081 (Segmentation fault in simple_iv (tree-scalar-evolution.c:3151))
2013-04-29 Richard Biener <rguenther@suse.de>
PR tree-optimization/57081
* loop-init.c: Include tree-flow.h.
(loop_optimizer_finalize): Free number of iteration estimates.
* Makefile.in (loop-init.o): Add $(TREE_FLOW_H) dependency.
* gcc.dg/torture/pr57081.c: New testcase.
From-SVN: r198392
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/loop-init.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr57081.c | 22 |
5 files changed, 38 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 262dbdf7..83f1c1a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-04-29 Richard Biener <rguenther@suse.de> + + PR tree-optimization/57081 + * loop-init.c: Include tree-flow.h. + (loop_optimizer_finalize): Free number of iteration estimates. + * Makefile.in (loop-init.o): Add $(TREE_FLOW_H) dependency. + 2013-04-29 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/57083 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 8dda925..903125e 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3181,7 +3181,7 @@ cfgloopmanip.o : cfgloopmanip.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) \ loop-init.o : loop-init.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(GGC_H) \ $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) \ coretypes.h $(TM_H) $(OBSTACK_H) $(TREE_PASS_H) $(FLAGS_H) \ - $(REGS_H) $(DF_H) + $(REGS_H) $(DF_H) $(TREE_FLOW_H) loop-unswitch.o : loop-unswitch.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(DUMPFILE_H) \ $(RTL_H) $(TM_H) $(BASIC_BLOCK_H) hard-reg-set.h $(CFGLOOP_H) $(PARAMS_H) \ diff --git a/gcc/loop-init.c b/gcc/loop-init.c index 664ff29..1f605c9 100644 --- a/gcc/loop-init.c +++ b/gcc/loop-init.c @@ -30,6 +30,7 @@ along with GCC; see the file COPYING3. If not see #include "flags.h" #include "df.h" #include "ggc.h" +#include "tree-flow.h" /* Apply FLAGS to the loop state. */ @@ -142,6 +143,8 @@ loop_optimizer_finalize (void) if (loops_state_satisfies_p (LOOPS_HAVE_RECORDED_EXITS)) release_recorded_exits (); + free_numbers_of_iterations_estimates (); + /* If we should preserve loop structure, do not free it but clear flags that advanced properties are there as we are not preserving that in full. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ddb11ec..e6cee3b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-04-29 Richard Biener <rguenther@suse.de> + + PR tree-optimization/57081 + * gcc.dg/torture/pr57081.c: New testcase. + 2013-04-29 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/57083 diff --git a/gcc/testsuite/gcc.dg/torture/pr57081.c b/gcc/testsuite/gcc.dg/torture/pr57081.c new file mode 100644 index 0000000..0fcbaaa --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr57081.c @@ -0,0 +1,22 @@ +/* { dg-do compile } */ + +int a; + +void f(void) +{ + int b; + + if(0) + lbl: + goto lbl; + + if(b) + { + int p = 0; + goto lbl; + } + + a = 0; + while(b++); + goto lbl; +} |