annotate gcc/testsuite/gcc.dg/max-1.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR middle-end/18548 */
kono
parents:
diff changeset
2 /* Test case reduced by Andrew Pinski <pinskia@physics.uc.edu> */
kono
parents:
diff changeset
3 /* { dg-do run } */
kono
parents:
diff changeset
4 /* { dg-options "-O1 " } */
kono
parents:
diff changeset
5 /* Option -fno-tree-lrs removed By Andrew MacLeod since it is no longer
kono
parents:
diff changeset
6 supported in the compiler beginning with GCC 4.3. */
kono
parents:
diff changeset
7 /* m32c has varying sized pointers */
kono
parents:
diff changeset
8 /* { dg-skip-if "" { "m32c-*-*" } { "*" } { "-mcpu=m32c" "-mcpu=m32cm" } } */
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 __extension__ typedef __INTPTR_TYPE__ intptr_t;
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 extern void abort (void);
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 intptr_t fff[10];
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 void f(intptr_t a, intptr_t b)
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 intptr_t crcc = b;
kono
parents:
diff changeset
19 intptr_t d = *((intptr_t*)(a+1));
kono
parents:
diff changeset
20 int i;
kono
parents:
diff changeset
21
kono
parents:
diff changeset
22 a = d >= b? d:b;
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 for(i=0;i<10;i++)
kono
parents:
diff changeset
26 fff[i] = a;
kono
parents:
diff changeset
27 }
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 /* The variable a cannot be a local variable as we get better aliasing
kono
parents:
diff changeset
30 now and decide that the store to a is dead. The better aliasing comes
kono
parents:
diff changeset
31 from better representation of pointer arithmetic. */
kono
parents:
diff changeset
32 intptr_t a = 10;
kono
parents:
diff changeset
33 int main(void)
kono
parents:
diff changeset
34 {
kono
parents:
diff changeset
35 int i;
kono
parents:
diff changeset
36 f((intptr_t)(&a)-1,0);
kono
parents:
diff changeset
37 for(i = 0;i<10;i++)
kono
parents:
diff changeset
38 if (fff[i]!=10)
kono
parents:
diff changeset
39 abort ();
kono
parents:
diff changeset
40 return 0;
kono
parents:
diff changeset
41 }
kono
parents:
diff changeset
42