Vladimir Makarov <vmaka...@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  <vmaka...@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  <hubi...@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

Reply via email to