diff mbox

[RFC] Fix pr34548 -- unnecessary alignment from alloca

Message ID 20120802090318.GB25368@bubble.grove.modra.org
State New
Headers show

Commit Message

Alan Modra Aug. 2, 2012, 9:03 a.m. UTC
On Tue, Jul 31, 2012 at 07:38:53PM -0700, Richard Henderson wrote:
> I've bootstrapped this on both ppc64 and x86_64.  I'll leave some time
> for comment, but I can't immediately see how this could go wrong anywhere.

r190051 of a powerpc-linux bootstrap dies trying to compile garbage
in stage2 gtype-desc.c, r190050 is OK.

[snip more differences]

configured with
CC="gcc -m32" \
~/src/gcc-virgin/configure --prefix=/home/amodra/gnu --build=powerpc-linux \
--with-cpu=default32 --enable-targets=powerpc64-linux --disable-nls \
--enable-secureplt --with-long-double-128 --enable-gnu-indirect-function \
--enable-cloog-backend=isl --disable-cloog-version-check \
--enable-languages=all

First difference in gengtype.o is

-    69e0:      38 63 00 1f     addi    r3,r3,31
+    69e0:      38 63 00 10     addi    r3,r3,16
     69e4:      54 69 00 36     rlwinm  r9,r3,0,0,27
     69e8:      80 7c 00 04     lwz     r3,4(r28)
     69ec:      7d 29 00 d0     neg     r9,r9
     69f0:      7d 41 49 6e     stwux   r10,r1,r9

which is a dynamic stack allocation.  I'm not sure what's going on
here, perhaps STACK_DYNAMIC_OFFSET related?

Comments

Richard Henderson Aug. 3, 2012, 3:33 a.m. UTC | #1
On 2012-08-02 02:03, Alan Modra wrote:
> r190051 of a powerpc-linux bootstrap dies trying to compile garbage
> in stage2 gtype-desc.c, r190050 is OK.

It took a while, but I found the problem.  The fact that the prologue
generation code didn't use the same alignment that we applied at in
function.c.

Now that I think about it, I'm actually surprised that this *does*
work on x86_65 and ppc64.  An accident of pre-existing alignment, I assume.

I've reverted the patch til I can figure out the best way to proceed.


r~
diff mbox

Patch

--- prev-gcc/gtype-desc.c	2012-08-02 04:02:13.000000000 -0400
+++ gcc/gtype-desc.c	2012-08-02 04:06:03.000000000 -0400
@@ -9988,7 +9988,7 @@ 
   {
     &x_rtl.expr.x_apply_args_value,
     1,
-    sizeof (x_rtl.expr.x_apply_args_value),
+    sizeof (x_rtl.expr.x_apply_args_valu����`��),
     &gt_ggc_mx_rtx_def,
     &gt_pch_nx_rtx_def
   },