[Bug middle-end/17657] [4.0 Regression] ICE in expand_case
--- Additional Comments From pinskia at gcc dot gnu dot org 2004-10-11 17:02 --- Fixed. -- What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17657
[Bug middle-end/17657] [4.0 Regression] ICE in expand_case
--- 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: [EMAIL PROTECTED] 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
[Bug middle-end/17657] [4.0 Regression] ICE in expand_case
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-10-11 03:42 --- Subject: Bug 17657 CVSROOT:/cvs/gcc Module name:gcc Changes by: [EMAIL PROTECTED] 2004-10-11 03:42:09 Modified files: gcc: ChangeLog fold-const.c tree.h gcc/cp : ChangeLog semantics.c typeck.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/init: for3.C gcc/testsuite/g++.dg/opt: switch2.C gcc/testsuite/g++.dg/warn: Wreturn-2.C Log message: 2004-10-10 Andrew Pinski <[EMAIL PROTECTED]> PR c++/17554 part of c++/17657 middle-end/17703 * semantics.c (maybe_cleanup_point_expr): Call fold_build_cleanup_point_expr. (maybe_cleanup_point_expr_void): New function. (add_decl_expr): Call maybe_cleanup_point_expr_void. (finish_expr_stmt): Likewise. (finish_return_stmt): Likewise. (finish_for_expr): Likewise. (finish_asm_stmt): Likewise. * typeck.c (condition_conversion): Call fold_build_cleanup_point_expr. 2004-10-10 Andrew Pinski <[EMAIL PROTECTED]> PR middle-end/17703 part of PR c++/17657 * fold-const.c (fold_build_cleanup_point_expr): New function. * tree.h (fold_build_cleanup_point_expr): Prototype. 2004-10-10 Andrew Pinski <[EMAIL PROTECTED]> PR c++/17554 * g++.dg/init/for3.C: New test. PR c++/17657 * g++.dg/opt/switch2.C: New test. PR middle-end/17703 * g++.dg/warn/Wreturn-2.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5829&r2=2.5830 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.467&r2=1.468 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.636&r2=1.637 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4420&r2=1.4421 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.444&r2=1.445 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.581&r2=1.582 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4432&r2=1.4433 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/for3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/switch2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/Wreturn-2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 --- 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. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17657
[Bug middle-end/17657] [4.0 Regression] ICE in expand_case
--- Additional Comments From cvs-commit at gcc dot gnu dot org 2004-10-11 03:42 --- Subject: Bug 17657 CVSROOT:/cvs/gcc Module name:gcc Changes by: [EMAIL PROTECTED] 2004-10-11 03:42:09 Modified files: gcc: ChangeLog fold-const.c tree.h gcc/cp : ChangeLog semantics.c typeck.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/init: for3.C gcc/testsuite/g++.dg/opt: switch2.C gcc/testsuite/g++.dg/warn: Wreturn-2.C Log message: 2004-10-10 Andrew Pinski <[EMAIL PROTECTED]> PR c++/17554 part of c++/17657 middle-end/17703 * semantics.c (maybe_cleanup_point_expr): Call fold_build_cleanup_point_expr. (maybe_cleanup_point_expr_void): New function. (add_decl_expr): Call maybe_cleanup_point_expr_void. (finish_expr_stmt): Likewise. (finish_return_stmt): Likewise. (finish_for_expr): Likewise. (finish_asm_stmt): Likewise. * typeck.c (condition_conversion): Call fold_build_cleanup_point_expr. 2004-10-10 Andrew Pinski <[EMAIL PROTECTED]> PR middle-end/17703 part of PR c++/17657 * fold-const.c (fold_build_cleanup_point_expr): New function. * tree.h (fold_build_cleanup_point_expr): Prototype. 2004-10-10 Andrew Pinski <[EMAIL PROTECTED]> PR c++/17554 * g++.dg/init/for3.C: New test. PR c++/17657 * g++.dg/opt/switch2.C: New test. PR middle-end/17703 * g++.dg/warn/Wreturn-2.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.5829&r2=2.5830 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fold-const.c.diff?cvsroot=gcc&r1=1.467&r2=1.468 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree.h.diff?cvsroot=gcc&r1=1.636&r2=1.637 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4420&r2=1.4421 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.444&r2=1.445 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.581&r2=1.582 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.4432&r2=1.4433 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/for3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/opt/switch2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/warn/Wreturn-2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17657