Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -fdump-tree-dom2-details -w --param logical-op-non-short-circuit=1" } */
3 /* { dg-additional-options "-fdisable-tree-thread1 -fdisable-tree-ethread -fdisable-tree-threadfull1" } */
4
5 enum optab_methods
6 {
7 OPTAB_DIRECT,
8 OPTAB_LIB,
9 OPTAB_WIDEN,
10 OPTAB_LIB_WIDEN,
11 OPTAB_MUST_WIDEN
12 };
13 struct optab_d { };
14 typedef struct optab_d *optab;
15 void expand_binop (optab, int, enum optab_methods);
16 void
17 expand_shift_1 (int code, int unsignedp, int rotate,
18 optab lshift_optab, optab rshift_arith_optab)
19 {
20 int left = (code == 42 || code == 0xde);
21 int attempt;
22 enum optab_methods methods;
23 if (attempt == 0)
24 methods = OPTAB_DIRECT;
25 else if (attempt == 1)
26 methods = OPTAB_WIDEN;
27 if ((!unsignedp || (!left && methods == OPTAB_WIDEN)))
28 {
29 enum optab_methods methods1 = methods;
30 if (unsignedp)
31 methods1 = OPTAB_MUST_WIDEN;
32 expand_binop (left ? lshift_optab : rshift_arith_optab,
33 unsignedp, methods1);
34 }
35 }
36
37 /* When UNSIGNEDP is true, LEFT is false and METHOD == OPTAB_WIDEN
38 we will enter the TRUE arm of the conditional and we can thread
39 the test to compute the first first argument of the expand_binop
40 call if we look backwards through the boolean logicals. */
41 /* { dg-final { scan-tree-dump-times "Threaded" 2 "dom2"} } */
42