2 /* { dg-options "-O2 -fno-inline -fpredictive-commoning -fdump-tree-pcom-details-blocks" } */
4 int arr
[105] = {2, 3, 5, 7, 11, 13, 17, 19};
5 int result0
[10] = {2, 3, 5, 7, 11, 13, 17, 19};
6 int result1
[10] = {0, -1, 5, -3, 11, -5, 17, 19};
7 int result2
[10] = {0, 0, -1, -3, -3, -5, -5, 19};
8 int result3
[10] = {0, 0, 0, -1, -3, -3, -5, -5};
9 int result4
[10] = {0, 0, 0, 0, -1, -3, -3, -5, -5};
10 int result100
[105] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
11 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
12 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
13 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
14 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
15 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
16 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -3, -3, -5, -5};
18 extern void abort (void);
20 void __attribute__((noinline
)) foo (int *a
, int len
)
23 for (i
= 0; i
< len
; i
++)
32 void check (int *a
, int *res
, int len
)
36 for (i
= 0; i
< len
; i
++)
44 check (arr
, result0
, 10);
47 check (arr
, result1
, 10);
50 check (arr
, result2
, 10);
53 check (arr
, result3
, 10);
56 check (arr
, result4
, 10);
59 check (arr
, result100
, 105);
63 /* { dg-final { scan-tree-dump "Store-stores chain" "pcom"} } */
64 /* { dg-final { scan-tree-dump-not "Invalid sum" "pcom" } } */