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

--- Comment #12 from Rich Felker <bugdal at aerifal dot cx> ---
> Can you make an example?  Maybe it can get optimized away afterwards, if it's 
> not used?

I'm sorry, I didn't see your question at the time, and trying to answer it now
I'm not sure I understand well enough. I think the behavior of function_symbol
in sh.c forces the patterns in sh.md to need to make the relative call. Maybe
if the ashlsi3 pattern used SFUNC_GOT instead of SFUNC_STATIC it would work
though.

If you can get this to work, I think the gratuitous loading of the callee GOT
value I was worried about would not happen, since these are not normal calls
but pseudo-instructions. So it might actually be lower-cost to do it this way,
except possibly for hitting the cache line where the value in the GOT appears.
And I think it would make dynamic libgcc work (assuming the libgcc code doesn't
access global data in any way, which is a rather bad assumption to be locked
into.

I'm not sure if making this change is better or worse than suppressing the
copying of the pseudo-instruction with bsrf in it.

Reply via email to