re PR tree-optimization/57081 (Segmentation fault in simple_iv (tree-scalar-evolution...
authorRichard Biener <rguenther@suse.de>
Mon, 29 Apr 2013 09:09:08 +0000 (09:09 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 29 Apr 2013 09:09:08 +0000 (09:09 +0000)
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

gcc/ChangeLog
gcc/Makefile.in
gcc/loop-init.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr57081.c [new file with mode: 0644]

index 262dbdf72d7c809095f6398c4abd4582b43ab1fb..83f1c1ac4a32bf03292ab769c78180fafeb093ba 100644 (file)
@@ -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
index 8dda925bd3b2cab48dcb125737a0fa24d19f0ec7..903125e750482f8c0c829edde359aad547925363 100644 (file)
@@ -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) \
index 664ff29dd5b89af91ad44873c81340c842f4f81a..1f605c9760622bbfc1ec4e993b0c0bfad3d8d314 100644 (file)
@@ -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"
 
 \f
 /* 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.  */
index ddb11ec13303e5cf78fee0eb258809653d1dab98..e6cee3bb6b6a9f41caaf8a9d63d5e7d80ba5054d 100644 (file)
@@ -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 (file)
index 0000000..0fcbaaa
--- /dev/null
@@ -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;
+}