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: [patch, mips] Allow users to avoid promoting prototypes.


"Steve Ellcey " <sellcey@imgtec.com> writes:
> MIPS architectures set TARGET_PROMOTE_PROTOTYPES to true.  I would like
> to have an option to set this to false in order to avoid extra masking
> when passing char or short types.  I don't think we can change this by
> default since it would affect the ABI, but I would like to allow users
> the option of turning if off if desired.
>
> Tested on mips-mti-elf.  OK for checkin?
>
> Steve Ellcey
> sellcey@imgtec.com
>
>
> 2013-05-02  Steve Ellcey  <sellcey@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.

If you want to change the TARGET_PROMOTE_PROTOTYPES part of the
ABI for mips*-mti-elf then that would be OK with me.  It would
be better done without a command-line option.

I'm less keen on adding -mpromote-prototypes to mips*-mti-elf,
both because of the large number of variations there already,
and because continuing to have -mno-promote-prototypes multilibs
would give the impression that the change isn't much of a win.

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


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