diff options
author | Jakub Jelinek <jakub@redhat.com> | 2016-01-11 18:57:43 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2016-01-11 18:57:43 +0100 |
commit | 5a32af0ec5853edb0260d9e439ac646af5daed52 (patch) | |
tree | a900a86ca298e55bd41a37695da0b36555812a8a /gcc | |
parent | 1ebd5558eb04938a62eaa8cbfaa24b0205326b87 (diff) | |
download | gcc-5a32af0ec5853edb0260d9e439ac646af5daed52.zip gcc-5a32af0ec5853edb0260d9e439ac646af5daed52.tar.gz gcc-5a32af0ec5853edb0260d9e439ac646af5daed52.tar.bz2 |
fold-const.c (fold_convertible_p): Don't return true for conversion of VECTOR_TYPE to same sized integral type.
* fold-const.c (fold_convertible_p): Don't return true
for conversion of VECTOR_TYPE to same sized integral type.
(fold_convert_loc): Fix up formatting. Fold conversion of
VECTOR_TYPE to same sized integral type using VIEW_CONVERT_EXPR
instead of NOP_EXPR.
From-SVN: r232236
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fold-const.c | 13 |
2 files changed, 11 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4f4bb00..5936b42 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2016-01-11 Jakub Jelinek <jakub@redhat.com> + * fold-const.c (fold_convertible_p): Don't return true + for conversion of VECTOR_TYPE to same sized integral type. + (fold_convert_loc): Fix up formatting. Fold conversion of + VECTOR_TYPE to same sized integral type using VIEW_CONVERT_EXPR + instead of NOP_EXPR. + PR tree-optimization/69214 * tree-vrp.c (simplify_cond_using_ranges): Don't propagate innerop into a comparison if SSA_NAME_OCCURS_IN_ABNORMAL_PHI. diff --git a/gcc/fold-const.c b/gcc/fold-const.c index abd5360..cd8dbdf 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -2182,11 +2182,8 @@ fold_convertible_p (const_tree type, const_tree arg) case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE: case POINTER_TYPE: case REFERENCE_TYPE: case OFFSET_TYPE: - if (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig) - || TREE_CODE (orig) == OFFSET_TYPE) - return true; - return (TREE_CODE (orig) == VECTOR_TYPE - && tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig))); + return (INTEGRAL_TYPE_P (orig) || POINTER_TYPE_P (orig) + || TREE_CODE (orig) == OFFSET_TYPE); case REAL_TYPE: case FIXED_POINT_TYPE: @@ -2241,11 +2238,11 @@ fold_convert_loc (location_t loc, tree type, tree arg) return fold_build1_loc (loc, NOP_EXPR, type, arg); if (TREE_CODE (orig) == COMPLEX_TYPE) return fold_convert_loc (loc, type, - fold_build1_loc (loc, REALPART_EXPR, - TREE_TYPE (orig), arg)); + fold_build1_loc (loc, REALPART_EXPR, + TREE_TYPE (orig), arg)); gcc_assert (TREE_CODE (orig) == VECTOR_TYPE && tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig))); - return fold_build1_loc (loc, NOP_EXPR, type, arg); + return fold_build1_loc (loc, VIEW_CONVERT_EXPR, type, arg); case REAL_TYPE: if (TREE_CODE (arg) == INTEGER_CST) |