aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Enkovich <enkovich.gnu@gmail.com>2015-11-09 15:11:02 +0000
committerIlya Enkovich <ienkovich@gcc.gnu.org>2015-11-09 15:11:02 +0000
commit0e657ecb98b8413b41975ddfce8e240186720977 (patch)
tree356c7ce476f9dfc1708d4f64fb523e2a036c35c9
parent0b3ecf755196df79c795c8b9bbcb735adbb604d0 (diff)
downloadgcc-0e657ecb98b8413b41975ddfce8e240186720977.zip
gcc-0e657ecb98b8413b41975ddfce8e240186720977.tar.gz
gcc-0e657ecb98b8413b41975ddfce8e240186720977.tar.bz2
optabs.c (expand_vec_cond_expr): Always get sign from type.
gcc/ * optabs.c (expand_vec_cond_expr): Always get sign from type. * tree.c (wide_int_to_tree): Support negative values for boolean. (build_nonstandard_boolean_type): Use signed type for booleans. From-SVN: r230022
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/optabs.c3
-rw-r--r--gcc/tree.c4
3 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e7d7c4b..9ee6c72 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2015-11-09 Ilya Enkovich <enkovich.gnu@gmail.com>
+
+ * optabs.c (expand_vec_cond_expr): Always get sign from type.
+ * tree.c (wide_int_to_tree): Support negative values for boolean.
+ (build_nonstandard_boolean_type): Use signed type for booleans.
+
2015-11-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/68248
diff --git a/gcc/optabs.c b/gcc/optabs.c
index fdcdc6a..44971ad 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5365,7 +5365,6 @@ expand_vec_cond_expr (tree vec_cond_type, tree op0, tree op1, tree op2,
op0a = TREE_OPERAND (op0, 0);
op0b = TREE_OPERAND (op0, 1);
tcode = TREE_CODE (op0);
- unsignedp = TYPE_UNSIGNED (TREE_TYPE (op0a));
}
else
{
@@ -5374,9 +5373,9 @@ expand_vec_cond_expr (tree vec_cond_type, tree op0, tree op1, tree op2,
op0a = op0;
op0b = build_zero_cst (TREE_TYPE (op0));
tcode = LT_EXPR;
- unsignedp = false;
}
cmp_op_mode = TYPE_MODE (TREE_TYPE (op0a));
+ unsignedp = TYPE_UNSIGNED (TREE_TYPE (op0a));
gcc_assert (GET_MODE_SIZE (mode) == GET_MODE_SIZE (cmp_op_mode)
diff --git a/gcc/tree.c b/gcc/tree.c
index ff414f7..50e1db0 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1439,7 +1439,7 @@ wide_int_to_tree (tree type, const wide_int_ref &pcst)
case BOOLEAN_TYPE:
/* Cache false or true. */
limit = 2;
- if (hwi < 2)
+ if (IN_RANGE (hwi, 0, 1))
ix = hwi;
break;
@@ -8072,7 +8072,7 @@ build_nonstandard_boolean_type (unsigned HOST_WIDE_INT precision)
type = make_node (BOOLEAN_TYPE);
TYPE_PRECISION (type) = precision;
- fixup_unsigned_type (type);
+ fixup_signed_type (type);
if (precision <= MAX_INT_CACHED_PREC)
nonstandard_boolean_type_cache[precision] = type;