This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc/config/arch/arch.opt: Option mask gen problem
- From: Jim Wilson <jimw at sifive dot com>
- To: Maxim Blinov <maxim dot blinov at embecosm dot com>
- Cc: GCC Development <gcc at gcc dot gnu dot org>
- Date: Mon, 22 Jul 2019 11:54:09 -0700
- Subject: Re: gcc/config/arch/arch.opt: Option mask gen problem
- References: <CADmoyEimubE3tWR4Z9jcvNrNutV1rT7dyDLnYs4=_8sdE4TUEA@mail.gmail.com>
On Mon, Jul 22, 2019 at 4:05 AM Maxim Blinov <maxim.blinov@embecosm.com> wrote:
> Is it possible, in the arch.opt file, to have GCC generate a bitmask
> relative to a user-defined variable without an associated name? To
> illustrate my problem, consider the following option file snippet:
> ...
> But, I don't want the user to be able to pass "-mbmi-zbb" or
> "-mno-bmi-zbb" on the command line:
If you don't want an option, why are you making changes to the
riscv.opt file? This is specifically for supporting command line
options.
Adding a variable here does mean that it will automatically be saved
and restored, and I can see the advantage of doing that, even if it is
only indirectly tied to options. You could add a variable here, and
then manually define the bitmasks yourself in riscv-opt.h or riscv.h.
Or you could just add the variable to the machine_function struct in
riscv.c, which will also automatically save and restore the variable.
Jim