This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Fix optab reinitialisation when $(CC) is GCC 4.0 or above
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, rsandifo at nildram dot co dot uk
- Date: Mon, 26 Nov 2007 04:54:24 -0500
- Subject: Re: RFA: Fix optab reinitialisation when $(CC) is GCC 4.0 or above
- References: <87wss5xsx9.fsf@firetop.home>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Nov 26, 2007 at 09:22:26AM +0000, Richard Sandiford wrote:
> After Jakub's recent (and very welcome) patch to speed up optabs
> initialisation, target_reinit no longer reinitialises the optab
> table properly when compiled with GCC 4.0 or above. This breaks
> the mips16 attribute.
Oops, didn't know that something is trying to reinitialize optabs.
> The change to init_optabs itself was search-and-replace, so I don't
> think it makes the function harder to maintain. All lines stay
> within the 80-column limit.
>
> Bootstrapped & regression-tested on x86_64-linux-gnu. Also
> regression-tested on mipsisa64-elfoabi, where it fixes several
> gcc.target/mips failures. I also checked that the file still
> works when compiled with gcc 3.4. OK to install?
Actually, I'm afraid this will create bigger code even on targets that never
need this, since the init_insn_codes argument is passed down.
Perhaps it would be better to remove new_optab altogether and insn_codes
setup code from init_convert_optab and instead add a new function,
static void
init_insn_codes (void)
{
int i, j, op;
for (op = 0; op < OTI_MAX; op++)
for (i = 0; i < NUM_MACHINE_MODES; i++)
optab_handler (&optab_table[op], i)->insn_code = CODE_FOR_nothing;
for (op = 0; op < COI_MAX; op++)
for (i = 0; i < NUM_MACHINE_MODES; i++)
for (j = 0; j < NUM_MACHINE_MODES; j++)
convert_optab_handler (&convert_optab_table[op], i, j)->insn_code
= CODE_FOR_nothing;
}
and call this either when not compiled with GCC 4.0 and above, or
when initializing for the second and later time.
Jakub