Message ID | 20121107.182318.296903589.kkojima@rr.iij4u.or.jp |
---|---|
State | New |
Headers | show |
> 2012-11-07 Kaz Kojima <kkojima@gcc.gnu.org> > > PR middle-end/49220 > * mode-switching.c (create_pre_exit): Set short_block if there > are no copy insns. OK, but clearly a rewrite of the function would be in order.
On Wed, Nov 7, 2012 at 10:57 AM, Eric Botcazou <ebotcazou@adacore.com> wrote: >> 2012-11-07 Kaz Kojima <kkojima@gcc.gnu.org> >> >> PR middle-end/49220 >> * mode-switching.c (create_pre_exit): Set short_block if there >> are no copy insns. > > OK, but clearly a rewrite of the function would be in order. Please also add the testcase from the PR to the testsuite. Uros.
--- ORIG/trunk/gcc/mode-switching.c 2012-11-06 07:33:20.000000000 +0900 +++ trunk/gcc/mode-switching.c 2012-11-07 07:55:25.000000000 +0900 @@ -322,7 +322,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