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: "Richard Guenther" <richard dot guenther at gmail dot com>
- To: "Jakub Jelinek" <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org, rsandifo at nildram dot co dot uk
- Date: Wed, 5 Dec 2007 10:28:47 +0100
- Subject: Re: RFA: Fix optab reinitialisation when $(CC) is GCC 4.0 or above
- References: <87wss5xsx9.fsf@firetop.home> <20071126095424.GD16835@devserv.devel.redhat.com> <874pex36nd.fsf@firetop.home>
On Dec 5, 2007 9:08 AM, Richard Sandiford <rsandifo@nildram.co.uk> wrote:
> Jakub Jelinek <jakub@redhat.com> writes:
> > 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.
>
> OK, no-one spoke out in favour of the original patch, and looking back,
> my comments were just foolish, sorry. So here's a patch to do what you
> suggest. Bootstrapped & regression-tested on x86_64-linux-gnu ({,-m32}).
> Also regression-tested on mipsisa64-elfoabi. The bootstrap compiler was
> GCC 3.4, so it can still build optabs.c. OK to install?
Ok.
Thanks,
Richard.
> Richard
>
>
> gcc/
> 200x-xx-xx Jakub Jelinek <jakub@redhat.com>
> Richard Sandiford <rsandifo@nildram.co.uk>
>
> * optabs.c (clear_insn_codes): New function.
> (new_optab): Delete.
> (init_optab, init_optabv): Don't call new_optab.
> (init_convert_optab): Don't clear the insn codes.
> (init_optabs): Call clear_insn_codes.