On Thu, Sep 15, 2011 at 10:52 AM, Michael Meissner <meiss...@linux.vnet.ibm.com> wrote: > The recent changes for the new code models tickled a latent bug in the GCC 4.6 > and 4.7 compilers with the AIX calling sequence (PR 50341). When you call a > function indirectly, the compiler has to save the current function's TOC > pointer that is in r2 on the stack frame, and then load the new function's TOC > pointer before doing the call. If the indirect function that you are calling > has the same TOC value as the current function, the code will run, but if the > indirection function has a different TOC (for example it is in the main > program, and the indirect call is in a shared library), the wrong address will > be used. > > The existing code did this by doing a split after reload has finished. > Scheduling after reload then moves the load of the new TOC. These patches for > GCC 4.6 and GCC 4.7 disable the splits so that the load of the new TOC is > always next to the bctrl instruction, preventing the compiler from moving the > load. Ideally, we can eventually tackle the underlying problem that we did > not > have the right dependencies to prevent the scheduler from moving the new TOC > load before the use.
ENOPATCH. It was originally splitting before reload and I had changed it to be splitting after reload assuming the dependencies would be correct. What is the instruction which is being described as not dependent on the load of r2? -- Andrew