@@ -543,6 +543,10 @@ func_checker::compare_loops (basic_block bb1, basic_block bb2)
return return_false_with_msg ("unroll");
if (!compare_variable_decl (l1->simduid, l2->simduid))
return return_false_with_msg ("simduid");
+ if ((l1->any_upper_bound != l2->any_upper_bound)
+ || (l1->any_upper_bound
+ && (l1->nb_iterations_upper_bound != l2->nb_iterations_upper_bound)))
+ return return_false_with_msg ("nb_iterations_upper_bound");
return true;
}
new file mode 100644
@@ -0,0 +1,28 @@
+int array[1000];
+void
+test (int a)
+{
+ if (__builtin_expect (a > 3, 1))
+ return;
+ for (int i = 0; i < a; i++)
+ array[i]=i;
+}
+void
+test2 (int a)
+{
+ if (__builtin_expect (a > 10, 1))
+ return;
+ for (int i = 0; i < a; i++)
+ array[i]=i;
+}
+int
+main()
+{
+ test(1);
+ test(2);
+ test(3);
+ test2(10);
+ if (array[9] != 9)
+ __builtin_abort ();
+ return 0;
+}