1 /* PR tree-optimization/96928 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -fdump-tree-phiopt2 -fdump-tree-optimized" } */
4 /* { dg-final { scan-tree-dump-times " = a_\[0-9]*\\\(D\\\) >> " 5 "phiopt2" } } */
5 /* The following check is done at optimized because a ^ (~b) is rewritten as ~(a^b)
6 and in the case of match.pd optimizing these ?:, the ~ is moved out already
7 by the time we get to phiopt2. */
8 /* { dg-final { scan-tree-dump-times "\\\^ c_\[0-9]*\\\(D\\\);" 1 "optimized" } } */
9 /* { dg-final { scan-tree-dump-times " = ~" 1 "phiopt2" } } */
10 /* { dg-final { scan-tree-dump-times " = \[abc_0-9\\\(\\\)D]* \\\^ " 5 "phiopt2" } } */
11 /* { dg-final { scan-tree-dump-not "a < 0" "phiopt2" } } */
16 return a
< 0 ? ~a
: a
;
22 return a
< 0 ? ~b
: b
;
26 baz (int a
, unsigned int b
)
28 return a
< 0 ? ~b
: b
;
32 qux (int a
, unsigned int c
)
34 return a
>= 0 ? ~c
: c
;
40 return a
>= 0 ? b
: ~b
;