diff options
author | Marek Polacek <polacek@redhat.com> | 2014-12-11 11:07:58 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2014-12-11 11:07:58 +0000 |
commit | 20bd649ae4d750de74647a354c856d05de2acb0c (patch) | |
tree | 22c03e8da3a902dc6f9f55eeee02c2dfeda09227 /gcc/tree-scalar-evolution.c | |
parent | f63950e56178b03d3adffc818b247eb6e1c6d340 (diff) | |
download | gcc-20bd649ae4d750de74647a354c856d05de2acb0c.zip gcc-20bd649ae4d750de74647a354c856d05de2acb0c.tar.gz gcc-20bd649ae4d750de74647a354c856d05de2acb0c.tar.bz2 |
fold-const.c (fold_negate_expr): Add ANY_INTEGRAL_TYPE_P check.
* fold-const.c (fold_negate_expr): Add ANY_INTEGRAL_TYPE_P check.
(extract_muldiv_1): Likewise.
(maybe_canonicalize_comparison_1): Likewise.
(fold_comparison): Likewise.
(tree_binary_nonnegative_warnv_p): Likewise.
(tree_binary_nonzero_warnv_p): Likewise.
* gimple-ssa-strength-reduction.c (legal_cast_p_1): Likewise.
* tree-scalar-evolution.c (simple_iv): Likewise.
(scev_const_prop): Likewise.
* tree-ssa-loop-niter.c (expand_simple_operations): Likewise.
* tree-vect-generic.c (expand_vector_operation): Likewise.
* tree.h (ANY_INTEGRAL_TYPE_CHECK): Define.
(ANY_INTEGRAL_TYPE_P): Define.
(TYPE_OVERFLOW_WRAPS, TYPE_OVERFLOW_UNDEFINED, TYPE_OVERFLOW_TRAPS):
Add ANY_INTEGRAL_TYPE_CHECK.
(any_integral_type_check): New function.
From-SVN: r218621
Diffstat (limited to 'gcc/tree-scalar-evolution.c')
-rw-r--r-- | gcc/tree-scalar-evolution.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-scalar-evolution.c b/gcc/tree-scalar-evolution.c index 5183cb8..7c698149 100644 --- a/gcc/tree-scalar-evolution.c +++ b/gcc/tree-scalar-evolution.c @@ -3267,7 +3267,8 @@ simple_iv (struct loop *wrto_loop, struct loop *use_loop, tree op, if (tree_contains_chrecs (iv->base, NULL)) return false; - iv->no_overflow = !folded_casts && TYPE_OVERFLOW_UNDEFINED (type); + iv->no_overflow = (!folded_casts && ANY_INTEGRAL_TYPE_P (type) + && TYPE_OVERFLOW_UNDEFINED (type)); return true; } @@ -3490,7 +3491,8 @@ scev_const_prop (void) /* If def's type has undefined overflow and there were folded casts, rewrite all stmts added for def into arithmetics with defined overflow behavior. */ - if (folded_casts && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (def))) + if (folded_casts && ANY_INTEGRAL_TYPE_P (TREE_TYPE (def)) + && TYPE_OVERFLOW_UNDEFINED (TREE_TYPE (def))) { gimple_seq stmts; gimple_stmt_iterator gsi2; |