comparison gcc/testsuite/gcc.dg/tree-ssa/loop-interchange-12.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
1 /* { dg-do run } */
2 /* { dg-options "-O2 -floop-interchange -fdump-tree-linterchange-details" } */
3
4 /* Copied from graphite/interchange-4.c */
5
6 #define DEBUG 0
7 #if DEBUG
8 #include <stdio.h>
9 #endif
10
11 unsigned u[1024];
12
13 static void __attribute__((noinline,noclone,noipa))
14 foo (int N, unsigned *res)
15 {
16 int i, j;
17 unsigned sum = 1;
18 for (i = 0; i < N; i++)
19 for (j = 0; j < N; j++)
20 sum = u[i + 2 * j] / sum;
21
22 *res = sum;
23 }
24
25 extern void abort ();
26
27 int
28 main (void)
29 {
30 int i, j;
31 unsigned res;
32
33 u[0] = 10;
34 u[1] = 200;
35 u[2] = 10;
36 u[3] = 10;
37
38 foo (2, &res);
39
40 #if DEBUG
41 fprintf (stderr, "res = %d \n", res);
42 #endif
43
44 if (res != 0)
45 abort ();
46
47 return 0;
48 }
49
50 /* { dg-final { scan-tree-dump-not "is interchanged" "linterchange"} } */