Debian Codegraph @

gcc/testsuite/gcc.dg/pr109732-1.c

raw
1 /* { dg-do run } */
2 /* fre1 is disable because it can figure out that the if return value is just `a` */
3 /* { dg-options "-O1 -fdisable-tree-fre1" } */
4
5 /* This code is done this way to have the false edge as 1st
6 successor edge of BB2. Normally the true edge would be
7 the first and you would not hit the bug. Also the way PHIs is
8 done needs to be such that 0 is first. */
9 [[gnu::noipa]]
10 _Bool f3(_Bool a)
11 {
12 if (a==0)
13 return 0;
14 else
15 return a;
16 }
17
18 int main()
19 {
20 if (f3(0))
21 __builtin_abort();
22 if (!f3(1))
23 __builtin_abort();
24 }