tree.c (free_lang_data_in_decl): Annotate all functio nbodies with DECL_FUNCTION_SPEC...
authorJan Hubicka <hubicka@ucw.cz>
Mon, 17 Nov 2014 16:48:29 +0000 (17:48 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 17 Nov 2014 16:48:29 +0000 (16:48 +0000)
* tree.c (free_lang_data_in_decl): Annotate all functio nbodies with
DECL_FUNCTION_SPECIFIC_TARGET.
* i386.c (ix86_set_current_function): Handle explicit default options.

* lto.c (lto_read_decls): Do not rebuild DECL_FUNCTION_SPECIFIC_TARGET.

From-SVN: r217659

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/lto/ChangeLog
gcc/lto/lto.c
gcc/tree.c

index 561fc438e9b60cea70675f04afbfb529c2b9430e..2660d5222a7b6f96e33eff70c4d29c12cbb22a08 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-17  Jan Hubicka  <hubicka@ucw.cz>
+
+       * tree.c (free_lang_data_in_decl): Annotate all functio nbodies with
+       DECL_FUNCTION_SPECIFIC_TARGET.
+       * i386.c (ix86_set_current_function): Handle explicit default options.
+
 2014-11-17  Ilya Enkovich  <ilya.enkovich@intel.com>
 
        * builtins.c (expand_builtin_memcpy_with_bounds): Use target hook
index 7942cec4595dbdaa85e674ef64c23eff81f782bb..3166e0378a20e45d199d7fe53490535067515782 100644 (file)
@@ -5083,7 +5083,7 @@ ix86_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));
@@ -5094,7 +5094,7 @@ ix86_set_current_function (tree fndecl)
              = save_target_globals_default_opts ();
        }
 
-      else if (old_tree)
+      else if (old_tree && old_tree != target_option_default_node)
        ix86_reset_to_default_globals ();
       ix86_previous_fndecl = fndecl;
     }
index 6975042cf279c121d19aaef49ce2e798c1cd1ba8..50d32f5948b750629e5c34b611a08c188fef2175 100644 (file)
@@ -1,3 +1,7 @@
+2014-11-17  Jan Hubicka  <hubicka@ucw.cz>
+
+       * lto.c (lto_read_decls): Do not rebuild DECL_FUNCTION_SPECIFIC_TARGET.
+
 2014-11-14  Jan Hubicka  <hubicka@ucw.cz>
 
        * lto.c (compare_tree_sccs_1): Compare cl_target_option_eq.
index ff7f9f63453d438ae4a41cb41268aa00c4c2c942..a1f109cdea682fd2bb708eed7b9e7e86e44d7758 100644 (file)
@@ -1935,15 +1935,6 @@ lto_read_decls (struct lto_file_decl_data *decl_data, const void *data,
              if (TREE_CODE (t) == INTEGER_CST
                  && !TREE_OVERFLOW (t))
                cache_integer_cst (t);
-             /* Re-build DECL_FUNCTION_SPECIFIC_TARGET, we need that
-                for both WPA and LTRANS stage.  */
-             if (TREE_CODE (t) == FUNCTION_DECL)
-               {
-                 tree attr = lookup_attribute ("target", DECL_ATTRIBUTES (t));
-                 if (attr)
-                   targetm.target_option.valid_attribute_p
-                       (t, NULL_TREE, TREE_VALUE (attr), 0);
-               }
              /* Register TYPE_DECLs with the debuginfo machinery.  */
              if (!flag_wpa
                  && TREE_CODE (t) == TYPE_DECL)
index 933e8eb4d615b5e70ae5f3df4577f801534d9002..498d52e648c1966c12e28ff0e01e40a06436624d 100644 (file)
@@ -5115,6 +5115,9 @@ free_lang_data_in_decl (tree decl)
             the PARM_DECL will be used in the function's body).  */
          for (t = DECL_ARGUMENTS (decl); t; t = TREE_CHAIN (t))
            DECL_CONTEXT (t) = decl;
+         if (!DECL_FUNCTION_SPECIFIC_TARGET (decl))
+           DECL_FUNCTION_SPECIFIC_TARGET (decl)
+             = target_option_default_node;
        }
 
       /* DECL_SAVED_TREE holds the GENERIC representation for DECL.