This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [arm, patch] Remove redundant promotion of function arguments


On Fri, 2004-04-16 at 14:07, Richard Earnshaw (Lists) wrote:
> On Fri, 2004-04-16 at 12:28, Paul Brook wrote:
> > > There's a problem with the ARM implementation.  Specifically, you've
> > > changed the ABI for the 'ATPCS' and APCS.  Previously those ABIs would
> > > promote things somewhat randomly (varies depending on the -march value)
> > > at the caller side, so you need TARGET_PROMOTE_PROTOTYPES to return TRUE
> > > when the ABI is not AAPCS conformant.
> > 
> > Ok. I only tested current gcc, which seemed to do the right thing.
> > 
> > > You should also poison PROMOTE_FOR_CALL_ONLY.
> > 
> > The patch below does both these. 
> > It also catches some uses of PROMOTE_FOR_CALL_ONLY that I missed.
> > 
> > Tested on sparc-sun-solaris2.8 and cross-compiler to arm-none-elf.
> > Ok?
> > 
> > Paul
> > 
> > 2004-04-15  Paul Brook  <paul@codesourcery.com>
> > 
> > 	* calls.c (precompute_arguments): Change ifdef PROMOTE_FOR_CALL_ONLY
> > 	to !PROMOTE_MODE.
> > 	* function.c (assign_temp): Ditto.
> > 	* system.h (PROMOTE_FOR_CALL_ONLY): Poison.
> > 	* config/arm/arm.c (arm_promote_prototypes): New function.
> > 	(TARGET_PROMOTE_PROTOTYPES): Use it.
> 
> This is OK.

Err, wait a minute.  

defined (PROMOTE_FOR_CALL_ONLY) != not defined (PROMOTE_MODE).

There were three cases in the old logic

1) Nothing defined
2) PROMOTE_MODE defined and PROMOTE_FOR_CALL_ONLY defined
3) PROMOTE_MODE defined

In the new logic the equivalents are now

1) Nothing defined
2) PROMOTE_FUNCTION_MODE defined
3) PROMOTE_MODE defined and PROMOTE_FUNCTION_MODE defined

So your change means that code in category 1 is now being treaded as
though it was in category 2.  This might, or might not, be OK in all
circumstances.  In the case of your change to calls.c I think it is
probably not.

R.


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