diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2013-03-21 17:33:33 +0100 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2013-03-21 16:33:33 +0000 |
commit | 08e0cda61db940bb3b312b44b6d96219f697c27a (patch) | |
tree | 32255bfeab9804ebb6cbd03117e49ca038c33706 /gcc/tree.h | |
parent | d08633b496a5820431e4049ee8a564796a42114d (diff) | |
download | gcc-08e0cda61db940bb3b312b44b6d96219f697c27a.zip gcc-08e0cda61db940bb3b312b44b6d96219f697c27a.tar.gz gcc-08e0cda61db940bb3b312b44b6d96219f697c27a.tar.bz2 |
tree.h (VECTOR_TYPE_P): New macro.
2013-03-21 Marc Glisse <marc.glisse@inria.fr>
gcc/
* tree.h (VECTOR_TYPE_P): New macro.
(VECTOR_INTEGER_TYPE_P, VECTOR_FLOAT_TYPE_P, FLOAT_TYPE_P,
TYPE_MODE): Use it.
* fold-const.c (fold_cond_expr_with_comparison): Use build_zero_cst.
VEC_COND_EXPR cannot be lvalues.
(fold_ternary_loc) <VEC_COND_EXPR>: Merge with the COND_EXPR case.
gcc/cp/
* call.c (build_conditional_expr_1): Fold VEC_COND_EXPR.
gcc/testsuite/
* g++.dg/ext/vector21.C: New testcase.
From-SVN: r196884
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -981,6 +981,10 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, #define STRIP_USELESS_TYPE_CONVERSION(EXP) \ (EXP) = tree_ssa_strip_useless_type_conversions (EXP) +/* Nonzero if TYPE represents a vector type. */ + +#define VECTOR_TYPE_P(TYPE) (TREE_CODE (TYPE) == VECTOR_TYPE) + /* Nonzero if TYPE represents an integral type. Note that we do not include COMPLEX types here. Keep these checks in ascending code order. */ @@ -1016,15 +1020,15 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, /* Nonzero if TYPE represents a vector integer type. */ -#define VECTOR_INTEGER_TYPE_P(TYPE) \ - (TREE_CODE (TYPE) == VECTOR_TYPE \ - && TREE_CODE (TREE_TYPE (TYPE)) == INTEGER_TYPE) +#define VECTOR_INTEGER_TYPE_P(TYPE) \ + (VECTOR_TYPE_P (TYPE) \ + && TREE_CODE (TREE_TYPE (TYPE)) == INTEGER_TYPE) /* Nonzero if TYPE represents a vector floating-point type. */ #define VECTOR_FLOAT_TYPE_P(TYPE) \ - (TREE_CODE (TYPE) == VECTOR_TYPE \ + (VECTOR_TYPE_P (TYPE) \ && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE) /* Nonzero if TYPE represents a floating-point type, including complex @@ -1034,7 +1038,7 @@ extern void omp_clause_range_check_failed (const_tree, const char *, int, #define FLOAT_TYPE_P(TYPE) \ (SCALAR_FLOAT_TYPE_P (TYPE) \ || ((TREE_CODE (TYPE) == COMPLEX_TYPE \ - || TREE_CODE (TYPE) == VECTOR_TYPE) \ + || VECTOR_TYPE_P (TYPE)) \ && SCALAR_FLOAT_TYPE_P (TREE_TYPE (TYPE)))) /* Nonzero if TYPE represents a decimal floating-point type. */ @@ -2116,7 +2120,7 @@ struct GTY(()) tree_block { /* Vector types need to check target flags to determine type. */ extern enum machine_mode vector_type_mode (const_tree); #define TYPE_MODE(NODE) \ - (TREE_CODE (TYPE_CHECK (NODE)) == VECTOR_TYPE \ + (VECTOR_TYPE_P (TYPE_CHECK (NODE)) \ ? vector_type_mode (NODE) : (NODE)->type_common.mode) #define SET_TYPE_MODE(NODE, MODE) \ (TYPE_CHECK (NODE)->type_common.mode = (MODE)) |