| 1 |
// { dg-do compile } |
| 2 |
// { dg-require-effective-target c++11 } |
| 3 |
// { dg-options "-O2 -Wmaybe-uninitialized --param logical-op-non-short-circuit=0" } |
| 4 |
long pow2p_hwi_x; |
| 5 |
bool exact_log2___trans_tmp_5, exact_log2___trans_tmp_4; |
| 6 |
int exact_log2(long x) { |
| 7 |
exact_log2___trans_tmp_5 = pow2p_hwi_x && exact_log2___trans_tmp_4; |
| 8 |
return exact_log2___trans_tmp_5 ? x : 1; |
| 9 |
} |
| 10 |
enum signop {}; |
| 11 |
template <typename T1, typename T2> void rshift(T1, T2, signop); |
| 12 |
struct generic_wide_int { |
| 13 |
template <typename T> generic_wide_int(T); |
| 14 |
}; |
| 15 |
template <unsigned N, typename> struct poly_int_pod { |
| 16 |
bool is_constant() const; |
| 17 |
template <typename T> bool is_constant(T *) const; |
| 18 |
int coeffs[N]; |
| 19 |
}; |
| 20 |
template <unsigned N, typename C> |
| 21 |
template <typename T> |
| 22 |
bool poly_int_pod<N, C>::is_constant(T *const_value) const { |
| 23 |
if (is_constant()) { |
| 24 |
*const_value = coeffs[0]; |
| 25 |
return true; |
| 26 |
} |
| 27 |
return false; |
| 28 |
} |
| 29 |
struct poly_int : poly_int_pod<1, int> { |
| 30 |
template <typename C0> poly_int(C0); |
| 31 |
}; |
| 32 |
enum tree_code_class {} tree_code_type; |
| 33 |
void tree_class_check_failed(int *, tree_code_class, char *, int, char *) |
| 34 |
__attribute__((__noreturn__)); |
| 35 |
int tree_class_check___t, tree_class_check___l, |
| 36 |
vect_gen_vector_loop_niters_loop_vinfo; |
| 37 |
char tree_class_check___f, tree_class_check___g; |
| 38 |
tree_code_class tree_class_check___class; |
| 39 |
int *tree_class_check() { |
| 40 |
if (tree_code_type) |
| 41 |
tree_class_check_failed(&tree_class_check___t, tree_class_check___class, |
| 42 |
&tree_class_check___f, tree_class_check___l, |
| 43 |
&tree_class_check___g); |
| 44 |
return &tree_class_check___t; |
| 45 |
} |
| 46 |
int *build_int_cst(int, long); |
| 47 |
bool is_gimple_val(int); |
| 48 |
void force_gimple_operand(int, int *, bool, int); |
| 49 |
void vect_gen_vector_loop_niters(bool niters_no_overflow) { |
| 50 |
poly_int vf(vect_gen_vector_loop_niters_loop_vinfo); |
| 51 |
int *log_vf = nullptr; |
| 52 |
long const_vf; |
| 53 |
if (vf.is_constant(&const_vf)) |
| 54 |
log_vf = build_int_cst(0, 0); |
| 55 |
if (is_gimple_val(0)) { |
| 56 |
int stmts; |
| 57 |
force_gimple_operand(0, &stmts, true, 0); |
| 58 |
if (stmts && log_vf) |
| 59 |
if (niters_no_overflow) { |
| 60 |
generic_wide_int __trans_tmp_1(tree_class_check()); |
| 61 |
int __trans_tmp_2 = exact_log2(const_vf); // { dg-bogus "uninitialized" } |
| 62 |
rshift(__trans_tmp_1, __trans_tmp_2, (signop)0); |
| 63 |
} |
| 64 |
} |
| 65 |
} |