1 /* Inspired by 'libgomp.oacc-c-c++-common/nvptx-sese-1.c'. */
3 /* { dg-additional-options -O1 } */
4 /* { dg-additional-options -fdump-tree-dom3-raw } */
13 if (foo1 (r
)) /* If this first 'if' holds... */
14 r
*= 2; /* ..., 'r' now has a zero-value lower-most bit... */
16 if (r
& 1) /* ..., so this second 'if' can never hold... */
17 { /* ..., so this is unreachable. */
18 /* In constrast, if the first 'if' does not hold ('foo1 (r) == 0'), the
19 second 'if' may hold, but we know ('foo1' being 'const') that
20 'foo1 (r) == 0', so don't have to re-evaluate it here: */
26 /* Thus, if optimizing, we only ever expect one call of 'foo1'.
27 { dg-final { scan-tree-dump-times {gimple_call <foo1,} 1 dom3 } } */
31 __attribute__((const))
44 /* { dg-final { scan-tree-dump-times {gimple_call <foo2,} 1 dom3 } } */
48 __attribute__((const))
56 if ((r
& 64) && ((r
& 8) || (r
& 4) || (r
& 2) || (r
& 1)))
61 /* { dg-final { scan-tree-dump-times {gimple_call <foo3,} 1 dom3 } } */
65 __attribute__((const))
78 /* { dg-final { scan-tree-dump-times {gimple_call <foo4,} 1 dom3 } } */
82 __attribute__((const))
85 int f5 (int r
) /* Works for both 'signed' and 'unsigned'. */
95 /* { dg-final { scan-tree-dump-times {gimple_call <foo5,} 1 dom3 } } */
99 __attribute__((const))
102 int f6 (unsigned int r
) /* 'unsigned' is important here. */
112 /* { dg-final { scan-tree-dump-times {gimple_call <foo6,} 1 dom3 } } */