Fix recently introduced error in expand_end_case.
authorBernd Schmidt <bernds@cygnus.co.uk>
Mon, 13 Mar 2000 19:35:38 +0000 (19:35 +0000)
committerBernd Schmidt <crux@gcc.gnu.org>
Mon, 13 Mar 2000 19:35:38 +0000 (19:35 +0000)
From-SVN: r32511

gcc/ChangeLog
gcc/stmt.c

index a6faefccff4f7a03c3d6e764f752b32e3fe9d206..1589abdf01e62766d1d9d9e2180c2f3117a63990 100644 (file)
@@ -1,3 +1,8 @@
+2000-03-13  Bernd Schmidt  <bernds@cygnus.co.uk>
+
+       * 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  <jakub@redhat.com>
 
        * config/sparc/sparc.md: Remove all traces of TARGET_LIVE_G0.
index 9be159dbc9233bdc082009a70ddb9749d1b9067b..e919cd2c152d17d818d9cea3496f6676940089ea 100644 (file)
@@ -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