This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR target/34001: Incorrect x86 fastcall behavior
On Tue, Nov 13, 2007 at 10:36:24AM -0800, H.J. Lu wrote:
> On Tue, Nov 13, 2007 at 08:28:55AM -0800, Mark Mitchell wrote:
> > H.J. Lu wrote:
> >
> > > stdcall is a Windows feature. However, using different calling
> > > conversions on Windows and non-Windows will make OS-independent
> > > assembly code hard to write. Given that we have been doing the wrong
> > > thing on Windows wthout noticing anything up to now, make it right
> > > shouldn't cause more trouble. We can add a warning when we detect the
> > > ABI correction.
> > >
> > > BTW, on Linux, we use regparm, which is more efficient than stdcall.
> >
> > Like I said, I think this is for the x86 maintainers to decide. But, I
> > think that breaking backwards compatibility, especially at the binary
> > level, is something we ought to think about very carefully.
> >
>
> It depends on how you see it. To me, the current behavior is binary
> incompatible with MS compilers, for which this feature is designed
> for. My patch makes it binary incompatible with older gcc, but
> makes the new gcc binary compatible with all assembly codes and
> object files which conform to gcc document as well as MS compilers.
>
We have changed the i386 fastcall abi between gcc 3.4 and gcc 4.0:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34001#c7
I think we should fix it for gcc 4.3. Jan, Uros, can you take a look
at it?
Thanks.
H.J.