Debian Codegraph @

gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-3.c

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