111
|
1 /* { dg-do compile } */
|
|
2 /* { dg-options "-O1 -fdump-tree-optimized" } */
|
|
3 /* { dg-additional-options "-mbranch-cost=1" { target { i?86-*-* x86_64-*-* mips*-*-* s390*-*-* avr*-*-* } } } */
|
|
4
|
|
5 _Bool f1(_Bool a, _Bool b)
|
|
6 {
|
|
7 if (a)
|
|
8 {
|
|
9 if (b)
|
|
10 return 1;
|
|
11 else
|
|
12 return 0;
|
|
13 }
|
|
14 return 0;
|
|
15 }
|
|
16
|
|
17
|
|
18 /* There should be only one if, the outer one; the inner one
|
|
19 should have been changed to straight line code with the
|
|
20 value of b (except that we don't fold ! (b != 0) into b
|
|
21 which can be fixed in a different patch).
|
|
22 Test this only when known to be !LOGICAL_OP_NON_SHORT_CIRCUIT,
|
|
23 otherwise ifcombine may convert this into return a & b;. */
|
|
24 /* { dg-final { scan-tree-dump-times "if" 1 "optimized" { target { i?86-*-* x86_64-*-* mips*-*-* s390*-*-* avr*-*-* } } } } */
|