2008-01-25 Douglas Gregor <doug.gregor@gmail.com>
[official-gcc.git] / gcc / testsuite / gcc.dg / max-1.c
bloba5f16056c31edcfa737669efeaa508751178e635
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 extern void abort (void);
12 long fff[10];
14 void f(long a, long b)
16 long crcc = b;
17 long d = *((long*)(a+1));
18 int i;
20 a = d >= b? d:b;
23 for(i=0;i<10;i++)
24 fff[i] = a;
27 /* The variable a cannot be a local variable as we get better aliasing
28 now and decide that the store to a is dead. The better aliasing comes
29 from better representation of pointer arithmetic. */
30 long a = 10;
31 int main(void)
33 int i;
34 f((long)(&a)-1,0);
35 for(i = 0;i<10;i++)
36 if (fff[i]!=10)
37 abort ();
38 return 0;