diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2018-07-07 08:49:04 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2018-07-07 08:49:04 +0000 |
commit | 4a669ac35988fa6de5931455fb59c713563bc58b (patch) | |
tree | 9d2011edd9c0f88e911bf1ca42ef0a447245abf3 /gcc/poly-int.h | |
parent | 962b3564e98b2634a2d001eceb946d8f15f9bfae (diff) | |
download | gcc-4a669ac35988fa6de5931455fb59c713563bc58b.zip gcc-4a669ac35988fa6de5931455fb59c713563bc58b.tar.gz gcc-4a669ac35988fa6de5931455fb59c713563bc58b.tar.bz2 |
tree-vrp.c (vrp_int_const_binop): Change overflow type to overflow_type.
* tree-vrp.c (vrp_int_const_binop): Change overflow type to
overflow_type.
(combine_bound): Use wide-int overflow calculation instead of
rolling our own.
* calls.c (maybe_warn_alloc_args_overflow): Change overflow type to
overflow_type.
* fold-const.c (int_const_binop_2): Same.
(extract_muldiv_1): Same.
(fold_div_compare): Same.
(fold_abs_const): Same.
* match.pd: Same.
* poly-int.h (add): Same.
(sub): Same.
(neg): Same.
(mul): Same.
* predict.c (predict_iv_comparison): Same.
* profile-count.c (slow_safe_scale_64bit): Same.
* simplify-rtx.c (simplify_const_binary_operation): Same.
* tree-chrec.c (tree_fold_binomial): Same.
* tree-data-ref.c (split_constant_offset_1): Same.
* tree-if-conv.c (idx_within_array_bound): Same.
* tree-scalar-evolution.c (iv_can_overflow_p): Same.
* tree-ssa-phiopt.c (minmax_replacement): Same.
* tree-vect-loop.c (is_nonwrapping_integer_induction): Same.
* tree-vect-stmts.c (vect_truncate_gather_scatter_offset): Same.
* vr-values.c (vr_values::adjust_range_with_scev): Same.
* wide-int.cc (wi::add_large): Same.
(wi::mul_internal): Same.
(wi::sub_large): Same.
(wi::divmod_internal): Same.
* wide-int.h: Change overflow type to overflow_type for neg, add,
mul, smul, umul, div_trunc, div_floor, div_ceil, div_round,
mod_trunc, mod_ceil, mod_round, add_large, sub_large,
mul_internal, divmod_internal.
(overflow_type): New enum.
(accumulate_overflow): New.
cp/
* decl.c (build_enumerator): Change overflow type to overflow_type.
* init.c (build_new_1): Same.
From-SVN: r262494
Diffstat (limited to 'gcc/poly-int.h')
-rw-r--r-- | gcc/poly-int.h | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/gcc/poly-int.h b/gcc/poly-int.h index b3b61e2..c2cd2c2 100644 --- a/gcc/poly-int.h +++ b/gcc/poly-int.h @@ -917,17 +917,17 @@ add (const Ca &a, const poly_int_pod<N, Cb> &b) template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)> add (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, - signop sgn, bool *overflow) + signop sgn, wi::overflow_type *overflow) { typedef WI_BINARY_RESULT (Ca, Cb) C; poly_int<N, C> r; POLY_SET_COEFF (C, r, 0, wi::add (a.coeffs[0], b.coeffs[0], sgn, overflow)); for (unsigned int i = 1; i < N; i++) { - bool suboverflow; + wi::overflow_type suboverflow; POLY_SET_COEFF (C, r, i, wi::add (a.coeffs[i], b.coeffs[i], sgn, &suboverflow)); - *overflow |= suboverflow; + wi::accumulate_overflow (*overflow, suboverflow); } return r; } @@ -1016,17 +1016,17 @@ sub (const Ca &a, const poly_int_pod<N, Cb> &b) template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)> sub (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, - signop sgn, bool *overflow) + signop sgn, wi::overflow_type *overflow) { typedef WI_BINARY_RESULT (Ca, Cb) C; poly_int<N, C> r; POLY_SET_COEFF (C, r, 0, wi::sub (a.coeffs[0], b.coeffs[0], sgn, overflow)); for (unsigned int i = 1; i < N; i++) { - bool suboverflow; + wi::overflow_type suboverflow; POLY_SET_COEFF (C, r, i, wi::sub (a.coeffs[i], b.coeffs[i], sgn, &suboverflow)); - *overflow |= suboverflow; + wi::accumulate_overflow (*overflow, suboverflow); } return r; } @@ -1060,16 +1060,16 @@ neg (const poly_int_pod<N, Ca> &a) template<unsigned int N, typename Ca> inline poly_int<N, WI_UNARY_RESULT (Ca)> -neg (const poly_int_pod<N, Ca> &a, bool *overflow) +neg (const poly_int_pod<N, Ca> &a, wi::overflow_type *overflow) { typedef WI_UNARY_RESULT (Ca) C; poly_int<N, C> r; POLY_SET_COEFF (C, r, 0, wi::neg (a.coeffs[0], overflow)); for (unsigned int i = 1; i < N; i++) { - bool suboverflow; + wi::overflow_type suboverflow; POLY_SET_COEFF (C, r, i, wi::neg (a.coeffs[i], &suboverflow)); - *overflow |= suboverflow; + wi::accumulate_overflow (*overflow, suboverflow); } return r; } @@ -1136,16 +1136,16 @@ mul (const Ca &a, const poly_int_pod<N, Cb> &b) template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, WI_BINARY_RESULT (Ca, Cb)> mul (const poly_int_pod<N, Ca> &a, const Cb &b, - signop sgn, bool *overflow) + signop sgn, wi::overflow_type *overflow) { typedef WI_BINARY_RESULT (Ca, Cb) C; poly_int<N, C> r; POLY_SET_COEFF (C, r, 0, wi::mul (a.coeffs[0], b, sgn, overflow)); for (unsigned int i = 1; i < N; i++) { - bool suboverflow; + wi::overflow_type suboverflow; POLY_SET_COEFF (C, r, i, wi::mul (a.coeffs[i], b, sgn, &suboverflow)); - *overflow |= suboverflow; + wi::accumulate_overflow (*overflow, suboverflow); } return r; } |