[PATCH][C/C++] Do not promote return arguments
Andrew Haley
aph-gcc@littlepinkcloud.COM
Mon Aug 6 15:17:00 GMT 2007
Paolo Bonzini writes:
>
> > I don't think it breaks any standard C/C++ code, but the ABI allows
> > C/C++ code to be called from assembler (and other languages) and
> > defines how return values should be promoted. It's quite proper for
> > assembly code to assume that return values are promoted according to
> > their type, and this is where the libffi breakage came from.
> >
> > Also, non-portable C/C++code that assumes that short and char values
> > will be promoted to ints will be broken by this change. Sure, it's
> > nonstandard C/C++ code, but according to the ABI it shouldn't break.
> > We don't know how much code of this kind there is.
>
> I agree with Andrew, but OTOH I think that this is an i386 backend bug,
> previously masked by the C++ front-end.
That seems reasonable. However, let's fix the back end first,
shouldn't we?
Andrew.
More information about the Gcc-patches
mailing list