[Bug middle-end/17657] [4.0 Regression] ICE in expand_case

cvs-commit at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Oct 11 16:11:00 GMT 2004


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-11 03:42 -------
The orginal testcase is now fixed by the patch to the C++ front-end.
------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-10-11 16:11 -------
Subject: Bug 17657

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	sayle@gcc.gnu.org	2004-10-11 16:11:37

Modified files:
	gcc            : ChangeLog stmt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/gcc.dg: switch-4.c 

Log message:
	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.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5834&r2=2.5835
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/stmt.c.diff?cvsroot=gcc&r1=1.397&r2=1.398
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4434&r2=1.4435
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/switch-4.c.diff?cvsroot=gcc&r1=NONE&r2=1.1



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17657



More information about the Gcc-bugs mailing list