summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-20 22:51:23 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-11-20 22:51:23 +0000
commitbe813cbda16d8ae94d2b082caadeba7dfa59abf2 (patch)
tree7bc292966fb4b73d9aefab79ba82b8bad515712b /gcc
parent1504009c2352a5285d2beb31f486685bef8f2b4d (diff)
downloadgcc-be813cbda16d8ae94d2b082caadeba7dfa59abf2.tar.gz
2007-11-20 Richard Guenther <rguenther@suse.de>
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130324 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/gimplify.c2
-rw-r--r--gcc/stmt.c9
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr34154.c16
5 files changed, 35 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 291479ea3af..ac26d4075f7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2007-11-20 Richard Guenther <rguenther@suse.de>
+
+ 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.
+
2007-11-20 Rask Ingemann Lambertsen <rask@sygehus.dk>
* read-rtl.c (fatal_expected_char): Print EOF as text rather that
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 212a9dc1a60..8a74c3cc2be 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -1413,7 +1413,7 @@ gimplify_switch_expr (tree *expr_p, tree *pre_p)
{
/* Discard empty ranges. */
tree high = CASE_HIGH (elt);
- if (high && INT_CST_LT (high, low))
+ if (high && tree_int_cst_lt (high, low))
remove_element = TRUE;
}
else
diff --git a/gcc/stmt.c b/gcc/stmt.c
index f1be5e01aff..7d1a2662507 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);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index de6a6322a09..19f65a94ed5 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2007-11-20 Richard Guenther <rguenther@suse.de>
+
+ PR middle-end/34154
+ * testsuite/gcc.c-torture/execute/pr34154.c: New testcase.
+
2007-11-20 Uros Bizjak <ubizjak@gmail.com>
* gcc.dg/tree-ssa/20030714-1.c: Cleanup dom3 dump file.
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr34154.c b/gcc/testsuite/gcc.c-torture/execute/pr34154.c
new file mode 100644
index 00000000000..cd7bfc6b001
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr34154.c
@@ -0,0 +1,16 @@
+int foo( unsigned long long aLL )
+{
+ switch( aLL )
+ {
+ case 1000000000000000000ULL ... 9999999999999999999ULL : return 19 ;
+ default : return 20 ;
+ };
+};
+extern void abort (void);
+int main()
+{
+ unsigned long long aLL = 1000000000000000000ULL;
+ if (foo (aLL) != 19)
+ abort ();
+ return 0;
+}