new file mode 100644
@@ -0,0 +1,19 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-vectorize -fdbg-cnt=vect_loop:1" } */
+/* { dg-additional-options "-mavx2" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-prune-output "dbg_cnt 'vect_loop' set to 1" } */
+
+int a, b, g, h;
+int c[58];
+int d[58];
+int fn1() {
+ for (; g; g++)
+ if (a)
+ c[g] = b;
+}
+
+int fn2() {
+ fn1();
+ for (; h; h++)
+ d[h] = 0;
+}
@@ -536,7 +536,13 @@ vectorize_loops (void)
continue;
if (!dbg_cnt (vect_loop))
- break;
+ {
+ /* We may miss some if-converted loops due to
+ debug counter. Set any_ifcvt_loops to visit
+ them at finalization. */
+ any_ifcvt_loops = true;
+ break;
+ }
gimple *loop_vectorized_call = vect_loop_vectorized_call (loop);
if (loop_vectorized_call)