aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-04-24 16:39:21 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-04-24 16:39:21 -0400
commit1974bfb11f1d4a6326523185f9370b3b3a590f4e (patch)
tree7567f10695d25621d0d946524abe61c051962c73 /gcc
parent469b759e8cd3b6e0f8dd25e5099f89533b663310 (diff)
downloadgcc-1974bfb11f1d4a6326523185f9370b3b3a590f4e.zip
gcc-1974bfb11f1d4a6326523185f9370b3b3a590f4e.tar.gz
gcc-1974bfb11f1d4a6326523185f9370b3b3a590f4e.tar.bz2
(pushcase_range): Check for null range first.
From-SVN: r13977
Diffstat (limited to 'gcc')
-rw-r--r--gcc/stmt.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 04eaaff..01747b0 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -1,5 +1,5 @@
/* Expands front end tree to back end RTL for GNU C-Compiler
- Copyright (C) 1987, 88, 89, 92-5, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 92-6, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -4410,6 +4410,10 @@ pushcase (value, converter, label, duplicate)
if (! (case_stack && case_stack->data.case_stmt.start))
return 1;
+ /* Fail if the range is empty. */
+ if (tree_int_cst_lt (value2, value1))
+ return 4;
+
if (stack_block_stack
&& stack_block_stack->depth > case_stack->depth)
return 5;
@@ -4524,11 +4528,11 @@ pushcase_range (value1, value2, converter, label, duplicate)
/* Convert VALUEs to type in which the comparisons are nominally done. */
if (value1 == 0) /* Negative infinity. */
- value1 = TYPE_MIN_VALUE(index_type);
+ value1 = TYPE_MIN_VALUE (index_type);
value1 = (*converter) (nominal_type, value1);
if (value2 == 0) /* Positive infinity. */
- value2 = TYPE_MAX_VALUE(index_type);
+ value2 = TYPE_MAX_VALUE (index_type);
value2 = (*converter) (nominal_type, value2);
/* Fail if these values are out of range. */
@@ -4538,10 +4542,6 @@ pushcase_range (value1, value2, converter, label, duplicate)
if (! int_fits_type_p (value2, index_type))
return 3;
- /* Fail if the range is empty. */
- if (tree_int_cst_lt (value2, value1))
- return 4;
-
return add_case_node (value1, value2, label, duplicate);
}