Subject: Re: CVS commit: syssrc/sys/arch/powerpc/include
To: Noriyuki Soda <soda@sra.co.jp>
From: Matt Thomas <matt@3am-software.com>
List: tech-toolchain
Date: 08/07/2002 10:54:15
At 10:41 AM 8/7/2002, Noriyuki Soda wrote:
> >>>>> On Wed, 07 Aug 2002 10:24:29 -0700,
>         Matt Thomas <matt@3am-software.com> said:
>
> > It does match.
>
>Hmm, that's different from what I've read from
>gcc-3.1.1/gcc/config/rs6000:rs6000_build_va_list(),
>but I'm really novice about gcc internals, so I may be wrong.
>
>Are you sure?
>
> >>>>> On Wed, 07 Aug 2002 10:28:01 -0700,
>         Matt Thomas <matt@3am-software.com> said:
>
> > If it's not ABI compatible, then wouldn't you expect anything passing
> > a va_list as an argument to break?  Like vprintf?
>
>Hmmm...
>Perhaps vprintf() isn't good enough to test ABI compatibility, because
>va_list is last argument of the function. It is better to use a
>function which takes another argument after va_list (and test the
>another argument is correctly passed), or to look at assembler output.

The assembler output is reasonably close.  I looked at it.  Note that
by calling vprintf twice, the program iterates twice through the
va_list.  If the va_list wasn't being treated as a value by vprintf,
the second call the vprintf would have gotten a trashed va_list.

Anyway, SVR4 ABI passes large structures (like va_list) by reference
anyways.  So in either case a pointer is going to be passed.


-- 
Matt Thomas               Internet:   matt@3am-software.com
3am Software Foundry      WWW URL:    http://www.3am-software.com/bio/matt/
Cupertino, CA             Disclaimer: I avow all knowledge of this message