Fix ICE in substring-handling building 502.gcc_r (PR 87562)
[official-gcc.git] / gcc / testsuite / gcc.dg / pr18628.c
blobd365075b7291a3bac626879892f15b4d17eebe3d
1 /* { dg-do link } */
2 /* { dg-options "-O2" } */
4 /* PR middle-end/18628 exposed a problem in which cse folded a load
5 from a jump table into the label that was the target of the branch.
6 Unfortunately, the indirect jump was moved to a different basic
7 block, and the LABEL_REF copied to the register wasn't enough to
8 keep the cfg from optimizing the otherwise-unused label away. So
9 we ended up with a dangling reference to the label. */
11 int i;
13 int main()
15 for (;;)
17 switch (i)
19 case 0:
20 case 1:
21 return 1;
23 case 2:
24 case 3:
25 return 0;
27 case 5:
28 --i;