PR c/64856
[official-gcc.git] / gcc / testsuite / gcc.dg / max-1.c
blob9823dca597e11b39db4dd27dfa4fc4bfd4868b7d
1 /* PR middle-end/18548 */
2 /* Test case reduced by Andrew Pinski <pinskia@physics.uc.edu> */
3 /* { dg-do run } */
4 /* { dg-options "-O1 " } */
5 /* Option -fno-tree-lrs removed By Andrew MacLeod since it is no longer
6 supported in the compiler beginning with GCC 4.3. */
7 /* m32c has varying sized pointers */
8 /* { dg-skip-if "" { "m32c-*-*" } { "*" } { "-mcpu=m32c" "-mcpu=m32cm" } } */
10 __extension__ typedef __INTPTR_TYPE__ intptr_t;
12 extern void abort (void);
14 intptr_t fff[10];
16 void f(intptr_t a, intptr_t b)
18 intptr_t crcc = b;
19 intptr_t d = *((intptr_t*)(a+1));
20 int i;
22 a = d >= b? d:b;
25 for(i=0;i<10;i++)
26 fff[i] = a;
29 /* The variable a cannot be a local variable as we get better aliasing
30 now and decide that the store to a is dead. The better aliasing comes
31 from better representation of pointer arithmetic. */
32 intptr_t a = 10;
33 int main(void)
35 int i;
36 f((intptr_t)(&a)-1,0);
37 for(i = 0;i<10;i++)
38 if (fff[i]!=10)
39 abort ();
40 return 0;