Steve Ellcey <sell...@imgtec.com> writes: > On Thu, 2013-05-02 at 23:26 +0100, Richard Sandiford wrote: >> > 2013-05-02 Steve Ellcey <sell...@imgtec.com> >> > >> > * config/mips/mips.c (mips_promote_prototypes) :New. >> > (TARGET_PROMOTE_PROTOTYPES): Change to use mips_promote_prototypes. >> > * config/mips/mips.opt (mpromote-prototypes): New. >> >> It'd need an invoke.texi change too. >> >> The ABI thing is a problem though. Unlike the recent -mimadd option, >> this isn't something a user could reasonably turn on and off for >> individual files to see what happens. They'd need to rebuild all >> their libraries with it. And as written, the patch provides no way >> to compile gcc's own libraries that way, so they'd need to patch the >> gcc sources locally. > > I wasn't looking at providing an extra set of libraries, my assumption > was that the libraries would be compiled with the default setting of > promoting prototypes they way they are now and that these would still > work with objects that were compiled with -mno-promote-prototypes.
The problem is that TARGET_PROMOTE_PROTOTYPES is both a requirement on the caller and a guarantee to the callee. Any library function that takes a sub-int type is allowed to assume that the type is passed in extended form, and might be making use of that. And typedefs can make it less obvious which types are sub-int and which aren't. >> Ideally we'd also have a .gnu_attribute to record which promotion >> rules are being used, so that the linker can pick up incompatibilities. >> >> Sorry to be a pain... >> >> Thanks, >> Richard > > That's alright, I will drop this idea for now and perhaps look at > Richard Biener's idea (optimizing out the promotion on local calls) > later. Thanks, going with Richard's suggestion sounds good. Richard