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 <[email protected]>
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 ();
/* Reinitialize lang-dependent parts. */
lang_dependent_init_target ();