On 2014-12-08 10:41 AM, Richard Sandiford wrote:
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:


I don't know this code well, Richard. I've just see that IRA data is undefined after save_target_globals, e.g. max_struct_costs_size has value zero which never should happen. As save_target_globals calls
target_reinit and target_reinit has a comment

/* Reinitialize everything when target parameters, such as register usage,
   have changed.  */

I think it is natural reinitialize data for IRA from here.

I'd appreciate if somebody look at this problem as it is not RA one per se. It is very easy to reproduce even on x86 build for ppc target.

Reply via email to