OSDN Git Service

* MAINTAINERS (c4x port): Remove.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / max-1.c
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" } } */
9
10 extern void abort (void);
11
12 long fff[10];
13
14 void f(long a, long b)
15 {
16   long crcc = b;
17   long d = *((long*)(a+1));
18   int i;
19
20   a = d >= b? d:b;
21
22
23   for(i=0;i<10;i++)
24    fff[i] = a;
25 }
26
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)
32 {
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;
39 }
40