This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: patch to fix PR64157
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: Vladimir Makarov <vmakarov at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 08 Dec 2014 15:41:41 +0000
- Subject: Re: RFA: patch to fix PR64157
- Authentication-results: sourceware.org; auth=none
- References: <5482356B dot 4070400 at redhat dot com>
Vladimir Makarov <vmakarov@redhat.com> writes:
> The following patch fixes
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64157
>
>
> After calling target_reinit from save_target_globals for switchable
> targets (as ppc), a lot of ira data (register sets, classes etc) become
> undefined. After that ira-costs.c crashes when the undefined data are used.
>
> The patch was successfully bootstrapped and tested on x86-64.
>
> Ok to commit to the trunk?
>
> 2014-12-05 Vladimir Makarov <vmakarov@redhat.com>
>
> PR rtl-optimization/64157
> * toplev.c (target_reinit): Call ira_init.
>
> Index: toplev.c
> ===================================================================
> --- toplev.c (revision 218378)
> +++ toplev.c (working copy)
> @@ -1888,6 +1888,8 @@ target_reinit (void)
> /* This invokes target hooks to set fixed_reg[] etc, which is
> mode-dependent. */
> init_regs ();
> + /* Set IRA data depended on target parameters. */
> + ira_init ();
Could you give more details about how this happens? It's reverting part of:
2014-06-25 Jan Hubicka <hubicka@ucw.cz>
* toplev.c (backend_init_target): Move init_emit_regs and
init_regs to...
(backend_init) ... here; skip ira_init_once and backend_init_target.
(target_reinit) ... and here; clear
this_target_rtl->lang_dependent_initialized.
(lang_dependent_init_target): Clear
this_target_rtl->lang_dependent_initialized;
break out rtl initialization to ...
(initialize_rtl): ... here; call also backend_init_target
and ira_init_once.
* toplev.h (initialize_rtl): New function.
* function.c: Include toplev.h
(init_function_start): Call initialize_rtl.
* rtl.h (target_rtl): Add target_specific_initialized,
lang_dependent_initialized.
which was supposed to delay the ira_init so that it only gets called
once we start to compile a function. It sounds from your patch like
that either isn't early enough or isn't happening at all for some reason.
Thanks,
Richard