From aee8f91e3e94e017266fb76d36c32b4eef6acf88 Mon Sep 17 00:00:00 2001 From: wilson Date: Sat, 13 Nov 1999 01:04:19 +0000 Subject: [PATCH] Fix another gcc2 merge problem: fix switch statement ISO C conformancs bug * stmt.c (pushcase, pushcase_range): Partially revert Oct 28 change. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30515 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 4 ++++ gcc/stmt.c | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3e44db..7b10f81 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +Fri Nov 12 16:26:25 1999 Jim Wilson + + * stmt.c (pushcase, pushcase_range): Partially revert Oct 28 change. + Fri Nov 12 12:43:49 1999 Richard Henderson * unroll.c (unroll_loop): Make temp an unsigned HOST_WIDE_INT. diff --git a/gcc/stmt.c b/gcc/stmt.c index 17a2402..1f0d291 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -4535,6 +4535,10 @@ pushcase (value, converter, label, duplicate) if (index_type == error_mark_node) return 0; + /* Convert VALUE to the type in which the comparisons are nominally done. */ + if (value != 0) + value = (*converter) (nominal_type, value); + check_seenlabel (); /* Fail if this value is out of range for the actual type of the index @@ -4544,10 +4548,6 @@ pushcase (value, converter, label, duplicate) || ! int_fits_type_p (value, index_type))) return 3; - /* Convert VALUE to the type in which the comparisons are nominally done. */ - if (value != 0) - value = (*converter) (nominal_type, value); - /* Fail if this is a duplicate or overlaps another entry. */ if (value == 0) { @@ -4619,6 +4619,9 @@ pushcase_range (value1, value2, converter, label, duplicate) if (value2 == 0) value2 = TYPE_MAX_VALUE (nominal_type); + value1 = (*converter) (nominal_type, value1); + value2 = (*converter) (nominal_type, value2); + /* Fail if these values are out of range. */ if (TREE_CONSTANT_OVERFLOW (value1) || ! int_fits_type_p (value1, index_type)) @@ -4628,9 +4631,6 @@ pushcase_range (value1, value2, converter, label, duplicate) || ! int_fits_type_p (value2, index_type)) return 3; - value1 = (*converter) (nominal_type, value1); - value2 = (*converter) (nominal_type, value2); - return add_case_node (value1, value2, label, duplicate); } -- 2.7.4