This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH, committed] SFmode arg padding and va_arg cleanup
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: David Edelsohn <dje at watson dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 Aug 2004 17:24:12 +0930
- Subject: Re: [PATCH, committed] SFmode arg padding and va_arg cleanup
- References: <200407141501.i6EF19D27854@makai.watson.ibm.com> <20040726103437.GS7099@bubble.modra.org> <200407261423.i6QENaD10702@makai.watson.ibm.com> <20040728022547.GC15182@bubble.modra.org> <20040728023702.GE15182@bubble.modra.org>
On Wed, Jul 28, 2004 at 12:07:02PM +0930, Alan Modra wrote:
> On Wed, Jul 28, 2004 at 11:55:47AM +0930, Alan Modra wrote:
> > Applied mainline after testing powerpc64-linux.
> > * config/rs6000/rs6000.c (function_arg_padding): Pad SFmode upwards.
> I'd like to apply this to the 3.4 branch too. OK?
I don't know what happened during my testing, but clearly I didn't test
the source I actually committed. Regressions all over the place. :-(
Sorry, I think this patch needs reverting.
As I said in http://gcc.gnu.org/ml/gcc-patches/2004-07/msg02370.html,
there's a problem with returning "none" from function_arg_padding too,
with the size of float args being calculated incorrectly. The following
testcase shows va_arg looking in the wrong place for an arg that follows
a float, if we return "none". It also happens to show the current
breakage when returning "upward"..
int foo (float f1, ...)
if (f1 != 1.0f)
__builtin_va_start (ap, f1);
if (__builtin_va_arg (ap, int) != 2)
int main (void)
return foo (1.0f, 2);
There is also a problem in that returning "none" doesn't actually do the
right thing according to the current ABI: SFmode, when passed in gprs
as well as fprs (eg. non-prototyped function) is passed in the least
significant end of the gpr, which corresponds to the second word of a
doubleword in the parameter save area.
So, I'm inclined to think that both patches should be reverted, and we
modify the ppc64 ABI to state that floats are passed in the second word
of a doubleword. ie. in the word with the higher address.
IBM OzLabs - Linux Technology Centre