OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [tree-ssa/] [predcom-5.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* { dg-do run } */
3
/* { dg-options "-O2 -fpredictive-commoning -fdump-tree-pcom-details" } */
4
 
5
/* Test for predictive commoning of expressions, with reassociation.  */
6
 
7
void abort (void);
8
 
9
unsigned a[1000], b[1000], c[1000], d[1000];
10
 
11
int main(void)
12
{
13
  unsigned i;
14
 
15
  for (i = 0; i < 1000; i++)
16
    a[i] = b[i] = d[i] = i;
17
 
18
  for (i = 1; i < 998; i++)
19
    c[i] = d[i + 1] * a[i + 2] * b[i + 1] - b[i - 1] * a[i] * d[i - 1];
20
 
21
  for (i = 1; i < 998; i++)
22
    if (c[i] != (i+1)*(i+2)*(i+1) - (i - 1) * i * (i - 1))
23
      abort ();
24
 
25
  return 0;
26
}
27
 
28
/* { dg-final { scan-tree-dump-times "Combination" 2 "pcom"} } */
29
/* { dg-final { scan-tree-dump-times "Unrolling 3 times." 1 "pcom"} } */
30
/* { dg-final { cleanup-tree-dump "pcom" } } */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.