svn merge -r102224:107263 svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-3_4-branch
[official-gcc.git] / gcc / testsuite / gcc.dg / 20040305-1.c
blob62b920c5e1b2eaf9b7aea2fb33df7d73c680bd04
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" } */
11 int f;
12 int g;
13 int h;
15 int* x = &f;
16 int* p1 = &g;
17 int* p2 = &h;
19 int
20 foo(void)
23 if (*x == 0)
25 x = p1; /* mvc - memory to memory */
26 p1 = (int*)0; /* st - register to memory */
27 return 1;
29 if (*x == 5)
31 f = 1;
32 g = 2;
34 p2 = (int*)0; /* st */
35 return 1;
39 int
40 main (int argc, char** argv)
42 foo ();
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 ();