blob: 574d6e6722c075056b6b2f30f51a4ba789adc863 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
/* PR tree-optimization/46194 */
/* { dg-do compile } */
/* { dg-options "-O -ftree-parallelize-loops=2 -fdump-tree-parloops-details" } */
#define N 1000
int a[N];
int foo (void)
{
int j;
int i;
/* This is not blocked as it is not profitable. */
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
a[j] = a[i] + 1;
return a[0];
}
/* This loop cannot be parallelized due to a dependence. */
/* { dg-final { scan-tree-dump-times "SUCCESS: may be parallelized" 0 "parloops" } } */
/* { dg-final { cleanup-tree-dump "parloops" } } */
|