Debian Codegraph @

gcc/testsuite/gcc.dg/torture/pr117243-2.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fno-tree-ch -fdump-tree-optimized" } */
3 /* { dg-skip-if "" { *-*-* } { "-fno-fat-lto-objects" } { "" } } */
4
5 /* PR tree-optimization/117243 */
6 /* PR tree-optimization/116749 */
7
8 /* main1 should be an infinite but sometimes it gets optimized incorrectly into
9 an __builtin_unreachable(); which is not valid. */
10 int main1 (void)
11 {
12 int g=0;
13 int l1[1];
14 int *l2 = &g;
15 int i;
16 for (i=0; i<1; i++)
17 l1[i] = (1);
18 for (g=0; g; ++g)
19 {
20 int *l3[1] = {&l1[0]};
21 }
22 *l2 = *l1;
23 b:
24 for (i=0; i<2; ++i)
25 {
26 if (i)
27 goto b;
28 if (g)
29 continue;
30 }
31 return 0;
32 }
33
34 /* { dg-final { scan-tree-dump-not "__builtin_unreachable " "optimized"} } */