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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [vect/] [pr48172.c] - Blame information for rev 801

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

Line No. Rev Author Line
1 689 jeremybenn
extern void *memset(void *s, int c, __SIZE_TYPE__ n);
2
extern void abort (void);
3
 
4
#define ASIZE 1028
5
#define HALF (ASIZE/2)
6
 
7
int main() {
8
  unsigned int array[ASIZE];
9
  int i;
10
 
11
  memset(array, 0, sizeof(array));
12
 
13
  /* initialize first half of the array */
14
  for (i = 0; i < HALF; i++)
15
    array[i] = i;
16
 
17
  /* fill second half of array in by summing earlier elements of the array
18
     gcc 4.5.1 and 4.5.2 incorrectly vectorize this loop!  aray[1025] is left
19
     at 0 for ASIZE=1028 */
20
  for (i = 0; i < HALF-1; i++)
21
    array[HALF+i] = array[2*i] + array[2*i + 1];
22
 
23
  /* see if we have any failures */
24
  for (i = 0; i < HALF - 1; i++)
25
    if (array[HALF+i] != array[2*i] + array[2*i + 1])
26
      abort ();
27
 
28
  return 0;
29
}
30
 
31
/* { dg-final { cleanup-tree-dump "vect" } } */

powered by: WebSVN 2.1.0

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