[PATCH, MIPS] Ensure default ASEs are applied for an architecture
Maciej W. Rozycki
macro@imgtec.com
Wed Mar 22 11:51:00 GMT 2017
On Wed, 22 Mar 2017, Maciej W. Rozycki wrote:
> > @@ -3918,8 +3926,6 @@ mips_check_options (struct mips_set_options *opts, bfd_boolean abi_checks)
> > static void
> > file_mips_check_options (void)
> > {
> > - const struct mips_cpu_info *arch_info = 0;
> > -
> > if (file_mips_opts_checked)
> > return;
> >
> > @@ -3962,8 +3968,6 @@ file_mips_check_options (void)
> > file_mips_opts.fp = 32;
> > }
> >
> > - arch_info = mips_cpu_info_from_arch (file_mips_opts.arch);
> > -
> > /* Disable operations on odd-numbered floating-point registers by default
> > when using the FPXX ABI. */
> > if (file_mips_opts.oddspreg < 0)
> > @@ -4007,7 +4011,7 @@ file_mips_check_options (void)
> >
> > /* If the user didn't explicitly select or deselect a particular ASE,
> > use the default setting for the CPU. */
> > - file_mips_opts.ase |= (arch_info->ase & ~file_ase_explicit);
> > + file_mips_opts.ase |= (file_mips_opts.init_ase & ~file_ase_explicit);
>
> This is the first place where `file_mips_opts.ase' is ever set AFAICT, so
> I think all that you need here is:
>
> file_mips_opts.ase &= ~file_ase_explicit;
>
> (and `arch_info' can of course go, as you did), with the hunk below
> changed accordingly:
>
> > @@ -14769,6 +14773,7 @@ mips_after_parse_args (void)
> >
> > file_mips_opts.arch = arch_info->cpu;
> > file_mips_opts.isa = arch_info->isa;
> > + file_mips_opts.init_ase = arch_info->ase;
>
> file_mips_opts.ase = arch_info->ase;
>
> The rest of the change can then go. Please verify that this does what's
> intended.
Hmm, I missed how `mips_set_ase' infers the ASE list set on the command
line. Apologies for misleading you.
I still think we don't want to have an extra `init_ase' member only used
once. I think we should reinstate the global `file_ase' variable removed
with commit 919731affbef (and complementing `file_ase_explicit' still
present there) and adjust the API of `mips_set_ase' so that it operates on
`unsigned int *ase_flags' instead of `struct mips_set_options *opts', and
then adjust call sites accordingly to refer to `&file_ase' or
`&mips_opts.ase' as appropriate. Then in `file_mips_check_options':
file_mips_opts.ase &= ~file_ase_explicit;
file_mips_opts.ase |= file_ase;
will do. Can you implement this?
Maciej
More information about the Binutils
mailing list