http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39423

--- Comment #27 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-08-10 
12:26:52 UTC ---
(In reply to comment #26)
> 
> I got an ICE in elimination_costs_in_insn, at reload1.c:3654 when applying to
> the 4.7 branch, but it seems to be resolved on trunk (hoping it's not hidden)
> so I guess you can close this defect as resolved.

This is probably due to the splitter part of the *movsi_index_disp patterns:

  [(set (match_dup 5) (ashift:SI (match_dup 1) (match_dup 2)))
   (set (match_dup 6) (plus:SI (match_dup 5) (match_dup 3)))
   (set (match_dup 0) (match_dup 7))]

The left shift won't match after this has been split, because there's no such
shift pattern.  On 4.7 it could be avoided by manually emitting the appropriate
shift insn in the preparation block of the splitter.  However, I'm not sure
whether it will be correct, due to the scratch regs and T_REG clobber in the
left shift patterns etc ... 
On trunk it is OK because the log2 shift sequences of the *movsi_index_disp
patterns will never clobber the T_REG... at least that's what I initially
thought, which is obviously wrong.  Left shifts of 15, 23, 29, 31 clobber T_REG
(if they are not converted to dynamic shifts).  These shift amounts are
probably not very likely to happen (e.g. tab[i * 8192 + 4]).  Still, they
should be handled.  I'll have a look at it, so let's keep this PR open for a
little bit longer...

Reply via email to