OSDN Git Service

* toplev.c (warn_deprecated_use): Correct logic for saying "type"
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.dg / 20040305-1.c
1
2 /* The testcase failed due to corrupted alias information.
3    During the crossjump analyzing step the mem alias info of the
4    st instructions are merged and get copied during basic block
5    reordering which leads to an insn with wrong alias info.
6    The scheduler afterwards exchanges the mvc and st instructions 
7    not recognizing the anti dependence.  */
8 /* { dg-do run { target s390-*-* } } */
9 /* { dg-options "-O3 -mtune=z990 -fno-inline" } */
10
11 int f;
12 int g;
13 int h;
14
15 int* x  = &f;
16 int* p1 = &g;
17 int* p2 = &h;
18
19 int
20 foo(void)
21 {
22
23   if (*x == 0)
24     {
25       x = p1;         /* mvc - memory to memory */
26       p1 = (int*)0;   /* st  - register to memory */
27       return 1;
28     }
29   if (*x == 5)
30     {
31       f = 1;
32       g = 2;
33
34       p2 = (int*)0;   /* st */   
35       return 1;
36     }
37 }
38
39 int
40 main (int argc, char** argv)
41 {
42   foo ();
43
44   /* If the scheduler has exchanged the mvc and st instructions,
45      x is 0. The expected result is &g.  */
46   if (x == &g)
47     exit (0);
48   else
49     abort ();
50 }