From: Kaz Kojima Date: Wed, 7 Nov 2012 10:48:12 +0000 (+0000) Subject: re PR middle-end/49220 (ICE in create_pre_exit, at mode-switching.c:401) X-Git-Tag: releases/gcc-4.8.0~2174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d78e64db2018951aee075a74bfa71bd9938fd1b7;p=thirdparty%2Fgcc.git re PR middle-end/49220 (ICE in create_pre_exit, at mode-switching.c:401) PR middle-end/49220 * mode-switching.c (create_pre_exit): Set short_block if there are no copy insns. From-SVN: r193289 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0445594efc1a..9444adc13324 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-11-07 Kaz Kojima + + PR middle-end/49220 + * mode-switching.c (create_pre_exit): Set short_block if there + are no copy insns. + 2012-11-07 Martin Jambor * lto-cgraph.c: Include tree-pass.h. diff --git a/gcc/mode-switching.c b/gcc/mode-switching.c index 386f8d1abe9d..2072628805be 100644 --- a/gcc/mode-switching.c +++ b/gcc/mode-switching.c @@ -322,7 +322,14 @@ create_pre_exit (int n_entities, int *entity_map, const int *num_modes) && 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) { last_insn = return_copy;