From 288bd0d74e6a6d324b564206d179d063d5ebd0f8 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 20 Nov 2007 22:51:23 +0000 Subject: re PR middle-end/34154 (gcc 4.1.1 bug / case ranges / unsigned long long) 2007-11-20 Richard Guenther PR middle-end/34154 * gimplify.c (gimplify_switch_expr): Use tree_int_cst_lt instead of the signed INT_CST_LT. * stmt.c (expand_case): Likewise. (estimate_case_costs): Likewise. * testsuite/gcc.c-torture/execute/pr34154.c: New testcase. From-SVN: r130324 --- gcc/stmt.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gcc/stmt.c') diff --git a/gcc/stmt.c b/gcc/stmt.c index f1be5e0..7d1a266 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -2360,7 +2360,7 @@ expand_case (tree exp) high = CASE_HIGH (elt); /* Discard empty ranges. */ - if (high && INT_CST_LT (high, low)) + if (high && tree_int_cst_lt (high, low)) continue; case_list = add_case_node (case_list, index_type, low, high, @@ -2387,9 +2387,9 @@ expand_case (tree exp) } else { - if (INT_CST_LT (n->low, minval)) + if (tree_int_cst_lt (n->low, minval)) minval = n->low; - if (INT_CST_LT (maxval, n->high)) + if (tree_int_cst_lt (maxval, n->high)) maxval = n->high; } /* A range counts double, since it requires two compares. */ @@ -2664,7 +2664,8 @@ estimate_case_costs (case_node_ptr node) for (n = node; n; n = n->right) { - if ((INT_CST_LT (n->low, min_ascii)) || INT_CST_LT (max_ascii, n->high)) + if (tree_int_cst_lt (n->low, min_ascii) + || tree_int_cst_lt (max_ascii, n->high)) return 0; for (i = (HOST_WIDE_INT) TREE_INT_CST_LOW (n->low); -- cgit v1.1