https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55212
--- Comment #167 from Oleg Endo <olegendo at gcc dot gnu.org> ---
(In reply to Kazumoto Kojima from comment #165)
> (In reply to Oleg Endo from comment #163)
> > (In reply to Kazumoto Kojima from comment #130)
> > > Created attachment 58831 [details]
> > > a trial patch for c#129
> > > 
> > > A quick fix may be:
> > > 
> > > * config/sh/sh.md
> > > (call_pcrel, call_value_pcrel, sibcall_pcrel): Use a fixed call clobberd
> > > register
> > > for the address.
> > 
> > I don't understand why the 'call_pcrel' insn splits out the constant load of
> > the call address only after reload?!  I think it could do that before
> > register allocation, when expanding the define_expand "call" pattern.  Or am
> > I missing something?
> 
> I also don't understand why these insn_and_split patterns are needed.  Maybe
> some issue with sh_expand_sym_label2reg before reload_completed?

If the constant load is exposed earlier, it could also be hoisted out of loops,
which would be better.

The call_pcrel and related patterns were added in 2000 ... maybe it was because
of SH5 support?  Not sure.  Perhaps the 'call_pcrel' expansion should be
somehow merged into the 'call' expansion.

Reply via email to