diff options
author | Marek Polacek <polacek@redhat.com> | 2015-06-26 22:35:29 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-06-26 22:35:29 +0000 |
commit | 315219515d9dd4bea8c44b9abf8ede57c0919fad (patch) | |
tree | 70d92b04f77e22e6df12fd0af70cce94eb8462dc /gcc/c-family | |
parent | e0ff153d398cdeb1864aa64f0045091c8bb2de98 (diff) | |
download | gcc-315219515d9dd4bea8c44b9abf8ede57c0919fad.zip gcc-315219515d9dd4bea8c44b9abf8ede57c0919fad.tar.gz gcc-315219515d9dd4bea8c44b9abf8ede57c0919fad.tar.bz2 |
c-common.c (check_main_parameter_types): Use VECTOR_TYPE_P or VECTOR_INTEGER_TYPE_P throughout.
* c-common.c (check_main_parameter_types): Use VECTOR_TYPE_P
or VECTOR_INTEGER_TYPE_P throughout.
* c-gimplify.c: Likewise.
* c-typeck.c: Use VECTOR_TYPE_P throughout.
From-SVN: r225089
Diffstat (limited to 'gcc/c-family')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 16 | ||||
-rw-r--r-- | gcc/c-family/c-gimplify.c | 2 |
3 files changed, 14 insertions, 10 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 512af7c..ffad035 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2015-06-27 Marek Polacek <polacek@redhat.com> + + * c-common.c (check_main_parameter_types): Use VECTOR_TYPE_P + or VECTOR_INTEGER_TYPE_P throughout. + * c-gimplify.c: Likewise. + 2015-06-26 Marek Polacek <polacek@redhat.com> * array-notation-common.c (find_rank): Use INDIRECT_REF_P. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 5cc65ec..06d2abc 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -2412,7 +2412,7 @@ check_main_parameter_types (tree decl) bool vector_targets_convertible_p (const_tree t1, const_tree t2) { - if (TREE_CODE (t1) == VECTOR_TYPE && TREE_CODE (t2) == VECTOR_TYPE + if (VECTOR_TYPE_P (t1) && VECTOR_TYPE_P (t2) && (TYPE_VECTOR_OPAQUE (t1) || TYPE_VECTOR_OPAQUE (t2)) && tree_int_cst_equal (TYPE_SIZE (t1), TYPE_SIZE (t2))) return true; @@ -2500,8 +2500,7 @@ c_build_vec_perm_expr (location_t loc, tree v0, tree v1, tree mask, || mask == error_mark_node) return error_mark_node; - if (TREE_CODE (TREE_TYPE (mask)) != VECTOR_TYPE - || TREE_CODE (TREE_TYPE (TREE_TYPE (mask))) != INTEGER_TYPE) + if (!VECTOR_INTEGER_TYPE_P (TREE_TYPE (mask))) { if (complain) error_at (loc, "__builtin_shuffle last argument must " @@ -2509,8 +2508,8 @@ c_build_vec_perm_expr (location_t loc, tree v0, tree v1, tree mask, return error_mark_node; } - if (TREE_CODE (TREE_TYPE (v0)) != VECTOR_TYPE - || TREE_CODE (TREE_TYPE (v1)) != VECTOR_TYPE) + if (!VECTOR_TYPE_P (TREE_TYPE (v0)) + || !VECTOR_TYPE_P (TREE_TYPE (v1))) { if (complain) error_at (loc, "__builtin_shuffle arguments must be vectors"); @@ -12482,7 +12481,7 @@ convert_vector_to_pointer_for_subscript (location_t loc, tree *vecp, tree index) { bool ret = false; - if (TREE_CODE (TREE_TYPE (*vecp)) == VECTOR_TYPE) + if (VECTOR_TYPE_P (TREE_TYPE (*vecp))) { tree type = TREE_TYPE (*vecp); tree type1; @@ -12548,8 +12547,7 @@ scalar_to_vector (location_t loc, enum tree_code code, tree op0, tree op1, bool integer_only_op = false; enum stv_conv ret = stv_firstarg; - gcc_assert (TREE_CODE (type0) == VECTOR_TYPE - || TREE_CODE (type1) == VECTOR_TYPE); + gcc_assert (VECTOR_TYPE_P (type0) || VECTOR_TYPE_P (type1)); switch (code) { /* Most GENERIC binary expressions require homogeneous arguments. @@ -12599,7 +12597,7 @@ scalar_to_vector (location_t loc, enum tree_code code, tree op0, tree op1, case LT_EXPR: case GT_EXPR: /* What about UNLT_EXPR? */ - if (TREE_CODE (type0) == VECTOR_TYPE) + if (VECTOR_TYPE_P (type0)) { ret = stv_secondarg; std::swap (type0, type1); diff --git a/gcc/c-family/c-gimplify.c b/gcc/c-family/c-gimplify.c index 317891f..98a6d53 100644 --- a/gcc/c-family/c-gimplify.c +++ b/gcc/c-family/c-gimplify.c @@ -248,7 +248,7 @@ c_gimplify_expr (tree *expr_p, gimple_seq *pre_p ATTRIBUTE_UNUSED, We should get rid of this conversion when we have a proper type demotion/promotion pass. */ tree *op1_p = &TREE_OPERAND (*expr_p, 1); - if (TREE_CODE (TREE_TYPE (*op1_p)) != VECTOR_TYPE + if (!VECTOR_TYPE_P (TREE_TYPE (*op1_p)) && !types_compatible_p (TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)), unsigned_type_node) && !types_compatible_p (TYPE_MAIN_VARIANT (TREE_TYPE (*op1_p)), |