summaryrefslogtreecommitdiff
path: root/gcc/stmt.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-01 18:51:12 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2005-06-01 18:51:12 +0000
commitb4bd95274759d0393bf1e3e2c625ba0b0d046de0 (patch)
tree24f4bde2341e587a951bda16272b126c8743ed39 /gcc/stmt.c
parent9ea9fcf0bcb5d466a36bd6ecd5536e09f1d53dc9 (diff)
downloadgcc-b4bd95274759d0393bf1e3e2c625ba0b0d046de0.tar.gz
2005-06-01 Richard Guenther <rguenth@gcc.gnu.org>
* stmt.c (expand_case): Use build_int_cst. (node_has_low_bound): Likewise, and correct type mismatch. (node_has_high_bound): Likewise. * fold-const.c (fold_binary): Ensure we build trees with the correct types - undo what STRIP_NOPS possibly did. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100459 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r--gcc/stmt.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 6bdaf51b9db..6df6eaa3e2e 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -2437,7 +2437,7 @@ expand_case (tree exp)
if (compare_tree_int (minval, 0) > 0
&& compare_tree_int (maxval, GET_MODE_BITSIZE (word_mode)) < 0)
{
- minval = fold_convert (index_type, integer_zero_node);
+ minval = build_int_cst (index_type, 0);
range = maxval;
}
emit_case_bit_tests (index_type, index_expr, minval, range,
@@ -2523,7 +2523,7 @@ expand_case (tree exp)
&& compare_tree_int (minval, 0) > 0
&& compare_tree_int (minval, 3) < 0)
{
- minval = fold_convert (index_type, integer_zero_node);
+ minval = build_int_cst (index_type, 0);
range = maxval;
}
@@ -2830,7 +2830,8 @@ node_has_low_bound (case_node_ptr node, tree index_type)
return 0;
low_minus_one = fold_build2 (MINUS_EXPR, TREE_TYPE (node->low),
- node->low, integer_one_node);
+ node->low,
+ build_int_cst (TREE_TYPE (node->low), 1));
/* If the subtraction above overflowed, we can't verify anything.
Otherwise, look for a parent that tests our value - 1. */
@@ -2880,7 +2881,8 @@ node_has_high_bound (case_node_ptr node, tree index_type)
return 0;
high_plus_one = fold_build2 (PLUS_EXPR, TREE_TYPE (node->high),
- node->high, integer_one_node);
+ node->high,
+ build_int_cst (TREE_TYPE (node->high), 1));
/* If the addition above overflowed, we can't verify anything.
Otherwise, look for a parent that tests our value + 1. */