diff options
author | glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-29 08:23:23 +0000 |
---|---|---|
committer | glisse <glisse@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-09-29 08:23:23 +0000 |
commit | f2c1848b0c8b71719007395498ed79c5b6aae905 (patch) | |
tree | 0b98a3c25fff30018c7011801207d5dbac884eed /gcc/gimple-fold.c | |
parent | 8baf772f69b30386f7b51cfc37ef32a719ebe519 (diff) | |
download | gcc-f2c1848b0c8b71719007395498ed79c5b6aae905.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191848 138bc75d-0d04-0410-961f-82ee72b054a4
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 4dba726f274..66d076664cc 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) |