]> git.ipfire.org Git - thirdparty/gcc.git/commit
re PR middle-end/17657 (ICE in expand_case)
authorRoger Sayle <roger@eyesopen.com>
Mon, 11 Oct 2004 16:11:35 +0000 (16:11 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Mon, 11 Oct 2004 16:11:35 +0000 (16:11 +0000)
commiteb172681f75b5ff4196bf4e670826a7f442eb90c
treefe3cbc69dccdda01ae79f78ed7e383ab4f17b65e
parent539ed333f6e84709a56649827401a1b1b6ceb374
re PR middle-end/17657 (ICE in expand_case)

PR middle-end/17657
* stmt.c (add_case_node): Add additional type argument.  Declare
as static to match prototype.  Convert the upper and lower bounds
to the specified index type.  Optimize away case ranges/values
that are outside the index type's bounds.  Truncate case ranges
that span the index type's bounds.
(expand_case): Avoid unnessary computation and memory allocation
when index type is error_mark_node.  Pass index_type as required
by change to add_case_node API.  No need to convert case range
bounds to index_type, this is now done by add_case_node.

* gcc.dg/switch-4.c: New test case.

From-SVN: r88881
gcc/ChangeLog
gcc/stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/switch-4.c [new file with mode: 0644]