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: Remove WORD_SWITCH_TAKES_ARG (Darwin testers useful)



On 5 Nov 2010, at 13:05, Jack Howarth wrote:


On Fri, Nov 05, 2010 at 01:15:10AM +0000, Joseph S. Myers wrote:
Continuing the ARM-sponsored series of option-handling cleanup patches
preparing for the multilib selection changes described at
<http://gcc.gnu.org/ml/gcc/2010-01/msg00063.html> (which changes to
multilib selection itself will now clearly need to wait for 4.7), this
71st patch in the series completes the removal of
WORD_SWITCH_TAKES_ARG.


After patch 70
<http://gcc.gnu.org/ml/gcc-patches/2010-10/msg02373.html> the only
remaining definition of this macro was for Darwin, because
WORD_SWITCH_TAKES_ARG was the only way of describing an option as
taking more than one argument and Darwin has such options (passed to
the linker by specs). This patch adds a facility to .opt files for
options to take more than one separate argument and describes the
Darwin options in the .opt file accordingly. (I do not expect any new
options to use this facility, as multi-argument options seem
confusingly different from normal practice for options.)


I added a two-bit field to the option flags to handle options with 1-4
arguments. A range of 0-3, by making CL_SEPARATE into a two-bit field
rather than using a separate field, would have sufficed, but making
CL_SEPARATE into a two-bit field would have involved more complicated
changes to --help handling that presumes flags are single bits; with
this patch the option-handling changes are safer and more
self-contained.


We are however quite close to running out of bits in the flags field;
bits 0-7 are used for languages, and 11-30 for other flags, and the Go
front end will cause bits 0-8 to be used for languages. That leaves
just two bits spare for languages, and I know that Debian at least
builds the compiler with driver support for two extra languages
(Pascal and D); I do not know if any distributors are building with
three or more extra languages. It shouldn't be hard to use bit 31
(making flags consistently unsigned), but beyond that it will be
necessary to split up flags in some way (maybe making those above
CL_MAX_OPTION_CLASS, or at least those not relevant to --help, into
bit-fields rather than allocating particular bits explicitly).


Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  I also
tested building xgcc for a cross to i686-darwin and examined the
decoded options under GDB, but it might be useful for someone to run
tests on Darwin (though I suspect a bootstrap and testsuite run may
not exercise the affected options).  OK to commit?

Bootstraps without regressions on x86_64-apple-darwin10...

and on i686-darwin9. (powerpc-d9 is running)


Additionally, I made a trivial example using the "-sectcreate" option - which produced the expected output.

thanks for the tidy-up!

Iain


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