re PR tree-optimization/71477 (gcc ICE at -O3 on valid code on x86_64-linux-gnu with...
authorRichard Biener <rguenther@suse.de>
Fri, 10 Jun 2016 07:30:45 +0000 (07:30 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 10 Jun 2016 07:30:45 +0000 (07:30 +0000)
2016-06-10  Richard Biener  <rguenther@suse.de>

PR middle-end/71477
* cfgloop.c (alloc_loop): Initialize nb_iterations_likely_upper_bound.

* gcc.dg/torture/pr71477.c: New testcase.

From-SVN: r237287

gcc/ChangeLog
gcc/cfgloop.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr71477.c [new file with mode: 0644]

index d1fcd18815d464049454d3157f91dd96fa5f9aff..c589250be68ced74f89d7c72e11b7ed93d3c986f 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-10  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/71477
+       * cfgloop.c (alloc_loop): Initialize nb_iterations_likely_upper_bound.
+
 2016-06-09  Eric Botcazou  <ebotcazou@adacore.com>
 
        * df-problems.c (df_note_bb_compute): Guard use of DF_INSN_INFO_GET.
index 27ccfb226c9778119046c3c95fff978533291451..5650f0d92c573eb76cb493a8adc7b03d336c6501 100644 (file)
@@ -331,6 +331,7 @@ alloc_loop (void)
   loop->exits->next = loop->exits->prev = loop->exits;
   loop->can_be_parallel = false;
   loop->nb_iterations_upper_bound = 0;
+  loop->nb_iterations_likely_upper_bound = 0;
   loop->nb_iterations_estimate = 0;
   return loop;
 }
index d2f9a702c4b393c37606a0e95f7d05d2ba45420f..c93f6fae010f4b34a8939bda2e1545689ba27e63 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-10  Richard Biener  <rguenther@suse.de>
+
+       PR middle-end/71477
+       * gcc.dg/torture/pr71477.c: New testcase.
+
 2016-06-09  Julia Koval  <julia.koval@intel.com>
 
        * gcc.target/i386/interrupt-12.c: Fix test for -fpic and corei7.
diff --git a/gcc/testsuite/gcc.dg/torture/pr71477.c b/gcc/testsuite/gcc.dg/torture/pr71477.c
new file mode 100644 (file)
index 0000000..c6d0c31
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+#define N 6
+int a;
+void fn1()
+{
+  int k = 0;
+  for (; k < N;)
+    for (a = 0; a < N; k++)
+      a = k + N;
+}