From: Trevor Saunders <tbsaunde+...@tbsaunde.org>

Hi,

the compiler crashes on pr52429.c because this_target_ira_int gets initialized
with null x_init_costs and x_op_costs.  While I don't really understand this 
option handling mess r217659 made the analogous change to i386 when it broke 
this.  So it seems likely this is the right way to fix the regression.

bootstrapped + regtested ppc64-linux-gnu, without regression and pr52429.c is
fixed, ok?


Trev

        gcc/

        * config/rs6000/rs6000.c (rs6000_set_current_function): Handle
        explicit default options.

diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 85eb0fd..207fc55 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -32609,7 +32609,7 @@ rs6000_set_current_function (tree fndecl)
       if (old_tree == new_tree)
        ;
 
-      else if (new_tree)
+      else if (new_tree && new_tree != target_option_default_node)
        {
          cl_target_option_restore (&global_options,
                                    TREE_TARGET_OPTION (new_tree));
@@ -32620,7 +32620,7 @@ rs6000_set_current_function (tree fndecl)
              = save_target_globals_default_opts ();
        }
 
-      else if (old_tree)
+      else if (old_tree && old_tree != target_option_default_node)
        {
          new_tree = target_option_current_node;
          cl_target_option_restore (&global_options,
-- 
2.1.4

Reply via email to