From: Richard Biener Date: Mon, 29 Apr 2013 09:09:08 +0000 (+0000) Subject: re PR tree-optimization/57081 (Segmentation fault in simple_iv (tree-scalar-evolution... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea78906a44deed40a23a5ef2362310e4d116c798;p=gcc.git re PR tree-optimization/57081 (Segmentation fault in simple_iv (tree-scalar-evolution.c:3151)) 2013-04-29 Richard Biener 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 262dbdf72d7..83f1c1ac4a3 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-04-29 Richard Biener + + 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 PR tree-optimization/57083 diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 8dda925bd3b..903125e7504 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 664ff29dd5b..1f605c97606 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 ddb11ec1330..e6cee3bb6b6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-04-29 Richard Biener + + PR tree-optimization/57081 + * gcc.dg/torture/pr57081.c: New testcase. + 2013-04-29 Jakub Jelinek 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 00000000000..0fcbaaa62b3 --- /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; +}