http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49220
Kazumoto Kojima <kkojima at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ice-on-invalid-code CC| |kkojima at gcc dot gnu.org --- Comment #1 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2011-05-29 12:39:21 UTC --- I think that create_pre_exit is used by SH target only. I'm testing the patch below. --- ORIG/trunk/gcc/mode-switching.c 2010-11-20 09:24:49.000000000 +0900 +++ trunk/gcc/mode-switching.c 2011-05-29 21:24:18.000000000 +0900 @@ -324,7 +324,14 @@ create_pre_exit (int n_entities, int *en && GET_CODE (SUBREG_REG (copy_reg)) == REG) copy_start = REGNO (SUBREG_REG (copy_reg)); else - break; + { + /* When control reaches end of non-void function, + there are no return copy insns at all. This + avoids an ice on that invalid function. */ + if (ret_start + nregs == ret_end) + short_block = 1; + break; + } if (copy_start >= FIRST_PSEUDO_REGISTER) break; copy_num