diff options
author | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-23 21:25:13 +0000 |
---|---|---|
committer | sayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-23 21:25:13 +0000 |
commit | 187b562a45f55d5b2bbdf49086e4cc2af3abf06b (patch) | |
tree | 9759e639cd287e6895534bee594b69640a3b17b7 /gcc/stmt.c | |
parent | 8583bf9c2cac6fb307dafba8a3c0445911b1aa76 (diff) | |
download | gcc-187b562a45f55d5b2bbdf49086e4cc2af3abf06b.tar.gz |
PR c/10178
* stmt.c (expand_end_case_type): Check for overflow in range when
determining whether to use a bit-test implementation.
* gcc.c-torture/compile/20030323-1.c: New test case.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64757 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/stmt.c')
-rw-r--r-- | gcc/stmt.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c index 823afbff7fa..d8f36c5d7db 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -5505,6 +5505,7 @@ expand_end_case_type (orig_index, orig_type) else if (CASE_USE_BIT_TESTS && ! TREE_CONSTANT (index_expr) && compare_tree_int (range, GET_MODE_BITSIZE (word_mode)) < 0 + && compare_tree_int (range, 0) > 0 && lshift_cheap_p () && ((uniq == 1 && count >= 3) || (uniq == 2 && count >= 5) |