From 72a4a8b0bc09f7600e05887f25de2cf9422e9d43 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 17 Nov 2014 17:48:29 +0100 Subject: [PATCH] tree.c (free_lang_data_in_decl): Annotate all functio nbodies with DECL_FUNCTION_SPECIFIC_TARGET. * 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 | 6 ++++++ gcc/config/i386/i386.c | 4 ++-- gcc/lto/ChangeLog | 4 ++++ gcc/lto/lto.c | 9 --------- gcc/tree.c | 3 +++ 5 files changed, 15 insertions(+), 11 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 561fc438e9b..2660d5222a7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2014-11-17 Jan Hubicka + + * 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 * builtins.c (expand_builtin_memcpy_with_bounds): Use target hook diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7942cec4595..3166e0378a2 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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; } diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 6975042cf27..50d32f5948b 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,7 @@ +2014-11-17 Jan Hubicka + + * lto.c (lto_read_decls): Do not rebuild DECL_FUNCTION_SPECIFIC_TARGET. + 2014-11-14 Jan Hubicka * lto.c (compare_tree_sccs_1): Compare cl_target_option_eq. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index ff7f9f63453..a1f109cdea6 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -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) diff --git a/gcc/tree.c b/gcc/tree.c index 933e8eb4d61..498d52e648c 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -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. -- 2.30.2