https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124643

--- Comment #10 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Richard Sandiford from comment #7)
> 
> I don't understand what the port is trying to do.  Why is zero-extension
> equivalent to a move?

Because T register is a 1-bit register.  So whatever way to get the 1-bit
value, either directly as SImode or in some way as HImode or QImode via subreg,
I just wanted anything to combine in the same way so that it can be used in
other insns as input operands.

> Why does sh_hard_regno_mode_ok specifically reject
> anything other than SImode for the T register, then go to such lengths to
> allow QImode references via extension?  If the T register is just a single
> bit, wouldn't QImode and HImode be valid too?

I guess T register ended up SImode because that was the easiest way to do this
thing when the SH port was initially created.  The more correct way would be
BImode these days.  But converting it seems like a rabbit hole and/or can of
worms.

> 
> Rejecting QImode for the T register is what makes validate_subreg reject the
> subreg.

All those complicated t_reg_operand things were actually expected to be there
only before RA.  It was to "help combine" find more opportunities around the T
register.  At that point there was no such thing as late-combine, so perhaps
that's where the problems come from.

Reply via email to