diff options
author | Marc Glisse <marc.glisse@inria.fr> | 2012-09-29 10:23:23 +0200 |
---|---|---|
committer | Marc Glisse <glisse@gcc.gnu.org> | 2012-09-29 08:23:23 +0000 |
commit | ae22ac3c62db451bae04a239d7b8c8b289e14ee7 (patch) | |
tree | 0b98a3c25fff30018c7011801207d5dbac884eed /gcc/gimple-fold.c | |
parent | b1d6986c94998636277821cb24b9b310da5f23e3 (diff) | |
download | gcc-ae22ac3c62db451bae04a239d7b8c8b289e14ee7.zip gcc-ae22ac3c62db451bae04a239d7b8c8b289e14ee7.tar.gz gcc-ae22ac3c62db451bae04a239d7b8c8b289e14ee7.tar.bz2 |
tree.c (truth_type_for): New function.
2012-09-29 Marc Glisse <marc.glisse@inria.fr>
* tree.c (truth_type_for): New function.
* tree.h (truth_type_for): Declare.
* gimple-fold.c (and_comparisons_1): Call it.
(or_comparisons_1): Likewise.
* tree-ssa-forwprop.c (forward_propagate_into_cond): Don't use
boolean_type_node for vectors.
From-SVN: r191848
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r-- | gcc/gimple-fold.c | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 4dba726..66d0766 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -30,7 +30,6 @@ along with GCC; see the file COPYING3. If not see #include "tree-ssa-propagate.h" #include "target.h" #include "gimple-fold.h" -#include "langhooks.h" /* Return true when DECL can be referenced from current unit. FROM_DECL (if non-null) specify constructor of variable DECL was taken from. @@ -1693,15 +1692,7 @@ static tree and_comparisons_1 (enum tree_code code1, tree op1a, tree op1b, enum tree_code code2, tree op2a, tree op2b) { - tree truth_type = boolean_type_node; - if (TREE_CODE (TREE_TYPE (op1a)) == VECTOR_TYPE) - { - tree vec_type = TREE_TYPE (op1a); - tree elem = lang_hooks.types.type_for_size - (GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (vec_type))), 0); - truth_type = build_opaque_vector_type (elem, - TYPE_VECTOR_SUBPARTS (vec_type)); - } + tree truth_type = truth_type_for (TREE_TYPE (op1a)); /* First check for ((x CODE1 y) AND (x CODE2 y)). */ if (operand_equal_p (op1a, op2a, 0) @@ -2165,15 +2156,7 @@ static tree or_comparisons_1 (enum tree_code code1, tree op1a, tree op1b, enum tree_code code2, tree op2a, tree op2b) { - tree truth_type = boolean_type_node; - if (TREE_CODE (TREE_TYPE (op1a)) == VECTOR_TYPE) - { - tree vec_type = TREE_TYPE (op1a); - tree elem = lang_hooks.types.type_for_size - (GET_MODE_BITSIZE (TYPE_MODE (TREE_TYPE (vec_type))), 0); - truth_type = build_opaque_vector_type (elem, - TYPE_VECTOR_SUBPARTS (vec_type)); - } + tree truth_type = truth_type_for (TREE_TYPE (op1a)); /* First check for ((x CODE1 y) OR (x CODE2 y)). */ if (operand_equal_p (op1a, op2a, 0) |