This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Use .opt files for the m68k port
Gunther Nikl <gni@gecko.de> writes:
> But I have question to the new option handling. In this message
>
> http://gcc.gnu.org/ml/gcc-patches/2004-06/msg02053.html
>
> you can find a proposal for a target option -mregparm for m68k. Its an
> option *and* a switch. Is that still possible? Having it an option and
> switch had problems with the option before the no- switch. since the
> option was handled after the switch.
Yes, this should work. You should also be able to avoid the
problem you mention.
First initialise m68k_regparm like this:
int m68k_regparm = M68K_DEFAULT_REGPARM;
then add two target option entries like this:
mregparm
Target Mask(REGPARM)
Help string...
mregparm=
Target RejectNegative Joined UInteger
Help string...
and then add something like this to handle_option:
case OPT_mregparm_:
target_flags |= MASK_REGPARM;
if (value < 1 || value > M68K_MAX_REGPARM)
error ("-mregparm=%d is not between 1 and %d",
value, M68K_MAX_REGPARM);
else
m68k_regparm = value;
return true;
(All untested of course. ;) There shouldn't be any need for code
in OVERRIDE_OPTIONS.
Richard