1 /* PR tree-optimization/29581 */ 2 /* Origin: gcc.dg/vect/vect-87.c */ 3 /* { dg-do run } */ 4 /* { dg-options "-O2 -ftree-loop-linear" } */ 5 6 extern void abort (void); 7 8 #define N 16 9 main1(int n,int * a)10int main1 (int n, int *a) 11 { 12 int i, j, k; 13 int b[N]; 14 15 for (i = 0; i < n; i++) 16 { 17 for (j = 0; j < n; j++) 18 { 19 k = i + n; 20 a[j] = k; 21 } 22 b[i] = k; 23 } 24 25 26 for (j = 0; j < n; j++) 27 if (a[j] != i + n - 1) 28 abort(); 29 30 for (j = 0; j < n; j++) 31 if (b[j] != j + n) 32 abort(); 33 34 return 0; 35 } 36 main(void)37int main (void) 38 { 39 int a[N] __attribute__ ((__aligned__(16))); 40 41 main1 (N, a); 42 main1 (0, a); 43 main1 (1, a); 44 main1 (2, a); 45 main1 (N-1, a); 46 47 return 0; 48 } 49