David Daney <ddaney@avtrex.com> writes:
This patch supplies correct call clobbered information for the global
pointer for the o32 and o64 ABIs.
Thanks for the patch. Unfortunately, although this is clearly correct
information at the ABI level, I don't think it's correct at the RTL level.
Until the call patterns are split -- if they ever are -- the patterns
include code to restore $gp. This means that $gp is preserved across
the unsplit call instructions, and that the current non-definition
of PIC_OFFSET_TABLE_REG_CALL_CLOBBERED is correct at that point.
The post-split calls explicitly clobber $gp, so I think we are already
providing correct information as far as the call instructions themselves
are concerned. I'm not claiming I can construct a test that wouldn't
work after the patch (to be honest, I haven't even tried). But it seems
dangerous in principle.
I've got a series of patches that I hope to submit before 4.4 is out.
As it happens, one of those patches included a fix for the same problem,
so I've split it out here. It brings about a 0.75% improvement in the
CSiBE score for little-endian MIPS64 code at -Os.
If you're happy with this approach, I can commit the patch separately
from the other stuff. (I'll test it on its own overnight.)