OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.dg/] [var-expand1.c] - Blame information for rev 604

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do compile } */
2
/* We don't (and don't want to) perform this optimisation on soft-float
3
   targets, where each addition is a library call.  */
4
/* { dg-require-effective-target hard_float } */
5
/* { dg-options "-O2 -funroll-loops --fast-math -fvariable-expansion-in-unroller -fdump-rtl-loop2_unroll" } */
6
 
7
extern void abort (void);
8
 
9
float array[10] = { 1,2,3,4,5,6,7,8,9,10 };
10
 
11
int foo (int n)
12
{
13
  unsigned i;
14
  float accum = 1.0;
15
 
16
  for (i = 0; i < n; i++)
17
    accum += array[i];
18
 
19
  return accum;
20
}
21
 
22
int main (void)
23
{
24
  return foo (10);
25
}
26
 
27
/* { dg-final { scan-rtl-dump "Expanding Accumulator" "loop2_unroll" } } */
28
/* { dg-final { cleanup-rtl-dump "loop*" } } */

powered by: WebSVN 2.1.0

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