OSDN Git Service

PR middle-end/17657
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Oct 2004 16:11:35 +0000 (16:11 +0000)
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 11 Oct 2004 16:11:35 +0000 (16:11 +0000)
commit8bacfa5896b8d430951e0400f574aa42b30f2174
treefe3cbc69dccdda01ae79f78ed7e383ab4f17b65e
parent5e8d5ca178a5bba22fa0f21174d0fe6809a85d90
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88881 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/stmt.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/switch-4.c [new file with mode: 0644]