[PATCH] Really fix PR target/24779 Python miscompilation - TOC reload

Andrew Pinski pinskia@gmail.com
Thu Dec 11 00:55:00 GMT 2008


Hi,
  The issue here is that the scheduler is moving an instruction which
might use the TOC register (but does not have an explicit dependency
on the TOC register) after the setting up the TOC register for an
indirect function call.  To fix this issue, we need to partly rewrite
the indirect function call instructions so that only after reload
(where the explicit dependency comes in) the setting up the TOC
register is split from the function call.

OK? Bootstrapped and tested on powerpc64-linux-gnu with no
regressions.  David Edelsohn also bootstrapped it on AIX without any
regressions.

Thanks,
Andrew Pinski

ChangeLog:

* config/rs6000/rs6000.md (call_indirect_aix32): Move the load of the
TOC into the call pattern.
(call_indirect_aix64): Likewise.
(call_value_indirect_aix32): Likewise.
(call_value_indirect_aix64): Likewise.
(call_indirect_nonlocal_aix32_internal): New insn and split patterns
to split off the load of the TOC.
(call_indirect_nonlocal_aix32): Enable only after reload.
(call_indirect_nonlocal_aix64_internal): New insn and split patterns
to split off the load of the TOC.
(call_indirect_nonlocal_aix64): Enable only after reload.
(call_value_indirect_nonlocal_aix32_internal): New insn and split
patterns to split off the load of the TOC.
(call_value_indirect_nonlocal_aix32): Enable only after reload.
(call_value_indirect_nonlocal_aix64_internal): New insn and split
patterns to split off the load of the TOC.
(call_value_indirect_nonlocal_aix64): Enable only after reload.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: t.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20081211/594211d0/attachment.txt>


More information about the Gcc-patches mailing list