[PATCH, rs6000] Preserve link stack for 476 cpus

Peter Bergner bergner@vnet.ibm.com
Fri Oct 28 17:39:00 GMT 2011

On Fri, 2011-10-28 at 08:20 -0700, Richard Henderson wrote:
> On 10/27/2011 06:43 PM, Peter Bergner wrote:
> > Ok, here's a patch to implement that, and it passes bootstrap and
> > regtesting.  Richard, is this what you had in mind?  I'll note that
> > I disabled rs6000_code_end for TARGET_POWERPC64, since I was running
> > into linker errors when building libgcc.  The merging of the thunk
> > routines with comdat worked fine, but the thunk function also has a
> > function descriptor and I couldn't figure out a way to get those
> > merged properly (if it's even possible), so they led to multiply
> > defined symbol linker errors.
> That's something you might have to discuss with David and Alan.

So David, do we even want to bother trying to support this on -m64
given the only cpu that needs this is a 32-bit only cpu?  If so, I
can try and work with Alan to figure out how we can merge the
function descriptors for the thunk routines when using -m64.

> It does look like you're missing the stub for ppc64, and yet
> you invoke it?  At least, I don't see anything earlier that
> tests ppc64, only in rs6000_code_end.

Oops, you're write.  Had I compiled with -m64 -mcpu=power7 -mtune=476fp,
I would have caught that.  I guess (supposing we don't want to support
64-bit) I should have the following hunks instead, correct?

+  /* If not explicitly specified via option, decide whether to generate the
+     extra blr's required to preserve the link stack on some cpus (eg, 476).  */
+  if (TARGET_LINK_STACK == -1)
+                          && flag_pic
+                          && !TARGET_POWERPC64);

+static void
+rs6000_code_end (void)
+  char name[32];
+  tree decl;
+    return;



More information about the Gcc-patches mailing list