diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-11-20 16:02:55 +0000 |
---|---|---|
committer | Richard Sandiford <richard.sandiford@linaro.org> | 2017-11-20 16:02:55 +0000 |
commit | d58952aefb03632bbb5b441d5c0bd330711f0af1 (patch) | |
tree | d046e56bfbd6a40106ae6ab96fafc954f1dfc955 /gcc/fold-const.c | |
parent | 648f8fc59b2cc39abd24f4c22388b346cdebcc31 (diff) | |
parent | 50221fae802a10fafe95e61d40504a58da33e98f (diff) | |
download | gcc-linaro-dev/sve.tar.gz |
Merge trunk into svelinaro-dev/sve
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index e92b5efed4a..f232b5a6d2a 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -435,7 +435,7 @@ negate_expr_p (tree t) case PLUS_EXPR: if (HONOR_SIGN_DEPENDENT_ROUNDING (element_mode (type)) || HONOR_SIGNED_ZEROS (element_mode (type)) - || (INTEGRAL_TYPE_P (type) + || (ANY_INTEGRAL_TYPE_P (type) && ! TYPE_OVERFLOW_WRAPS (type))) return false; /* -(A + B) -> (-B) - A. */ @@ -448,7 +448,7 @@ negate_expr_p (tree t) /* We can't turn -(A-B) into B-A when we honor signed zeros. */ return !HONOR_SIGN_DEPENDENT_ROUNDING (element_mode (type)) && !HONOR_SIGNED_ZEROS (element_mode (type)) - && (! INTEGRAL_TYPE_P (type) + && (! ANY_INTEGRAL_TYPE_P (type) || TYPE_OVERFLOW_WRAPS (type)); case MULT_EXPR: @@ -1604,14 +1604,14 @@ const_binop (enum tree_code code, tree arg1, tree arg2) return build_vector_from_val (TREE_TYPE (arg1), sub); } - if ((TREE_CODE (arg1) == INTEGER_CST || TREE_CODE (arg1) == REAL_CST) + if (CONSTANT_CLASS_P (arg1) && TREE_CODE (arg2) == VECTOR_CST) { tree_code subcode; switch (code) { - case STRICT_REDUC_PLUS_EXPR: + case FOLD_LEFT_PLUS_EXPR: subcode = PLUS_EXPR; break; default: @@ -9425,7 +9425,7 @@ fold_binary_loc (location_t loc, if ((code == BIT_AND_EXPR || code == BIT_IOR_EXPR || code == EQ_EXPR || code == NE_EXPR) - && TREE_CODE (TREE_TYPE (arg0)) != VECTOR_TYPE + && !VECTOR_TYPE_P (TREE_TYPE (arg0)) && ((truth_value_p (TREE_CODE (arg0)) && (truth_value_p (TREE_CODE (arg1)) || (TREE_CODE (arg1) == BIT_AND_EXPR |