Commit 2f985ca6 by Jim Wilson Committed by Jim Wilson

Fix another gcc2 merge problem: fix switch statement ISO C conformancs bug

Fix another gcc2 merge problem: fix switch statement ISO C conformancs bug
	* stmt.c (pushcase, pushcase_range): Partially revert Oct 28 change.

From-SVN: r30515
parent 3fa4114a
Fri Nov 12 16:26:25 1999 Jim Wilson <wilson@cygnus.com>
* stmt.c (pushcase, pushcase_range): Partially revert Oct 28 change.
Fri Nov 12 12:43:49 1999 Richard Henderson <rth@cygnus.com> Fri Nov 12 12:43:49 1999 Richard Henderson <rth@cygnus.com>
* unroll.c (unroll_loop): Make temp an unsigned HOST_WIDE_INT. * unroll.c (unroll_loop): Make temp an unsigned HOST_WIDE_INT.
......
...@@ -4535,6 +4535,10 @@ pushcase (value, converter, label, duplicate) ...@@ -4535,6 +4535,10 @@ pushcase (value, converter, label, duplicate)
if (index_type == error_mark_node) if (index_type == error_mark_node)
return 0; return 0;
/* Convert VALUE to the type in which the comparisons are nominally done. */
if (value != 0)
value = (*converter) (nominal_type, value);
check_seenlabel (); check_seenlabel ();
/* Fail if this value is out of range for the actual type of the index /* Fail if this value is out of range for the actual type of the index
...@@ -4544,10 +4548,6 @@ pushcase (value, converter, label, duplicate) ...@@ -4544,10 +4548,6 @@ pushcase (value, converter, label, duplicate)
|| ! int_fits_type_p (value, index_type))) || ! int_fits_type_p (value, index_type)))
return 3; 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. */ /* Fail if this is a duplicate or overlaps another entry. */
if (value == 0) if (value == 0)
{ {
...@@ -4619,6 +4619,9 @@ pushcase_range (value1, value2, converter, label, duplicate) ...@@ -4619,6 +4619,9 @@ pushcase_range (value1, value2, converter, label, duplicate)
if (value2 == 0) if (value2 == 0)
value2 = TYPE_MAX_VALUE (nominal_type); value2 = TYPE_MAX_VALUE (nominal_type);
value1 = (*converter) (nominal_type, value1);
value2 = (*converter) (nominal_type, value2);
/* Fail if these values are out of range. */ /* Fail if these values are out of range. */
if (TREE_CONSTANT_OVERFLOW (value1) if (TREE_CONSTANT_OVERFLOW (value1)
|| ! int_fits_type_p (value1, index_type)) || ! int_fits_type_p (value1, index_type))
...@@ -4628,9 +4631,6 @@ pushcase_range (value1, value2, converter, label, duplicate) ...@@ -4628,9 +4631,6 @@ pushcase_range (value1, value2, converter, label, duplicate)
|| ! int_fits_type_p (value2, index_type)) || ! int_fits_type_p (value2, index_type))
return 3; return 3;
value1 = (*converter) (nominal_type, value1);
value2 = (*converter) (nominal_type, value2);
return add_case_node (value1, value2, label, duplicate); return add_case_node (value1, value2, label, duplicate);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment