Call scev_const_prop in pass_parallelize_loops::execute
2015-11-17 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/68373
* tree-parloops.c (pass_parallelize_loops::execute): Call
scev_const_prop.
* gcc.dg/autopar/pr68373.c: New test.
---
gcc/testsuite/gcc.dg/autopar/pr68373.c | 14 ++++++++++++++
gcc/tree-parloops.c | 3 +++
2 files changed, 17 insertions(+)
new file mode 100644
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
+
+unsigned int
+foo (int *a, unsigned int n)
+{
+ unsigned int i;
+ for (i = 0; i < n; ++i)
+ a[i] = 1;
+
+ return i;
+}
+
+/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 1 "parloops" } } */
@@ -2787,6 +2787,9 @@ pass_parallelize_loops::execute (function *fun)
if (number_of_loops (fun) <= 1)
return 0;
+ unsigned int sccp_todo = scev_const_prop ();
+ gcc_assert (sccp_todo == 0);
+
if (parallelize_loops ())
{
fun->curr_properties &= ~(PROP_gimple_eomp);