------- Comment #3 from shenrfen at gmail dot com 2009-06-04 09:47 ------- I have debug the C++ front-end of gcc3.3.5. In function finish_switch_cond:
if (cond != error_mark_node) { cond = default_conversion (cond); cond = fold (build1 (CLEANUP_POINT_EXPR, TREE_TYPE (cond), cond)); } SRF: the type of cond is "int" if (cond != error_mark_node) { index = get_unwidened (cond, NULL_TREE); /* We can't strip a conversion from a signed type to an unsigned, because if we did, int_fits_type_p would do the wrong thing when checking case values for being in range, and it's too hard to do the right thing. */ if (TREE_UNSIGNED (TREE_TYPE (cond)) == TREE_UNSIGNED (TREE_TYPE (index))) cond = index; } SRF: bug the type of cond is back to "signed char" here..... Maybe there is something error in function "get_unwidened" -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40335