From f0c988c8238ee6c46c86200cda553592c97a6679 Mon Sep 17 00:00:00 2001 From: Bernd Schmidt Date: Mon, 13 Mar 2000 19:35:38 +0000 Subject: [PATCH] Fix recently introduced error in expand_end_case. From-SVN: r32511 --- gcc/ChangeLog | 5 +++++ gcc/stmt.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6faefccff4..1589abdf01e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2000-03-13 Bernd Schmidt + + * stmt.c (expand_end_case): RANGE may be signed, and when checking + whether it is too large we must also verify that it isn't negative. + 2000-03-13 Jakub Jelinek * config/sparc/sparc.md: Remove all traces of TARGET_LIVE_G0. diff --git a/gcc/stmt.c b/gcc/stmt.c index 9be159dbc92..e919cd2c152 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -5402,6 +5402,9 @@ expand_end_case (orig_index) else if (count < CASE_VALUES_THRESHOLD || compare_tree_int (range, 10 * count) > 0 + /* RANGE may be signed, and really large ranges will show up + as negative numbers. */ + || compare_tree_int (range, 0) < 0 #ifndef ASM_OUTPUT_ADDR_DIFF_ELT || flag_pic #endif -- 2.30.2