re PR testsuite/64039 (FAIL: gcc.dg/tree-ssa/ssa-dom-cse-2.c scan-tree-dump optimized...
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / ssa-dom-cse-2.c
blob1a4bfe65d974f7b3ce7e464f572dc20f368c15a5
1 /* { dg-do compile } */
2 /* { dg-options "-O3 -fno-tree-fre -fno-tree-pre -fdump-tree-optimized --param sra-max-scalarization-size-Ospeed=32" } */
3 /* System Z needs hardware vector support for this to work (the optimization
4 gets too complex without it.
5 { dg-additional-options "-march=z13" { target { s390x-*-* } } } */
8 int
9 foo ()
11 const int a[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };
12 int i, sum;
14 sum = 0;
15 for (i = 0; i < sizeof (a) / sizeof (*a); i++)
16 sum += a[i];
18 return sum;
21 /* After late unrolling the above loop completely DOM should be
22 able to optimize this to return 28. */
24 /* On alpha, the vectorizer generates writes of two vector elements at once,
25 but the loop reads only one element at a time, and DOM cannot resolve these.
26 The same happens on powerpc depending on the SIMD support available. */
28 /* { dg-final { scan-tree-dump "return 28;" "optimized" { xfail { { alpha*-*-* hppa*64*-*-* powerpc64*-*-* } || { sparc*-*-* && lp64 } } } } } */