This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: TESTCASE for varargs



On 08-Jun-98 Jeffrey A Law wrote:
> 
>   In message <98060521190800.04312@ns1102.munich.netsurf.de>you write:
>   > 
>   > this testcase FAILs on powerpc-unkown-linux-gnu.
> [ ... ]
> I assume this is the testcase for the weird varargs problem where
> we try to use a value before it's actually set inside the rs6000
> backend?
> 
> I thought I suggested some ways to try and make progress on this
> problem, but I never heard back from anyone on it (I can't remember
> if it was you, Geoff or someone else that I originally discussed
> the problem with).
> 
> Regardless, I've installed the testcase.
> 

The original discussion was probably with me :-)

I believe that you understand the problem.  This only affects PowerPC (RS6000)
with the SVR4 ABI (Solaris, Linux/PPC).  The crux is that the code that
sets up the stack for the varargs function does not know how many overflow
(stack based) arguments it will need to leave room for when the function
preamble is generated.  (It thinks it does, but the value it is using
hasn't been computed yet - thus your comment above).  Anyway, it currently
doesn't leave the proper amount of space [unpatched it leaves none] and
the overflow arguments end up overwriting the space where the incoming
varargs information was stored.

Very few programs are truly affected by this.  Only ones that call
a function with a large number of arguments (>7 I think) and use the
varargs after the call.  On Linux/PPC, I've installed a warning for this
case and of all the code I've compiled that see the warning, only one
program would have executed incorrectly.

However, it would be nice to fix this properly.

------------------------------------------------------------------------
Gary Thomas                              |
The Open Group / Research Institute      | "Fine wine is a necessity of
2 Avenue de Vignate                      |        life for me"
38610 Gieres - FRANCE                    |
+33 4 76 63 48 74                        |      Thomas Jefferson
email: g.thomas@opengroup.org            |
<http://www.opengroup.org/~gdt>          |
   ... opinions expressed here are mine  |
       and no one else would claim them! |
------------------------------------------------------------------------




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]