aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2018-12-15 11:31:37 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2018-12-15 10:31:37 +0000
commitee34ebba1573641e069bae17a228f597b3f57205 (patch)
treef9cfa15ead5147b2869ca2e67aa68f7a8ed9fb9a /gcc/ipa.c
parent1039d00c597ece034f51a66d085fa80f1f11d9e2 (diff)
downloadgcc-ee34ebba1573641e069bae17a228f597b3f57205.zip
gcc-ee34ebba1573641e069bae17a228f597b3f57205.tar.gz
gcc-ee34ebba1573641e069bae17a228f597b3f57205.tar.bz2
ipa.c (cgraph_build_static_cdtor_1): Add OPTIMIZATION and TARGET parameters.
* ipa.c (cgraph_build_static_cdtor_1): Add OPTIMIZATION and TARGET parameters. (cgraph_build_static_cdtor): Update. (build_cdtor): Use OPTIMIZATION and TARGET of the first real cdtor callsed. From-SVN: r267168
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 89fb1da..5916346 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -831,7 +831,9 @@ ipa_discover_variable_flags (void)
be produced. */
static void
-cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final)
+cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final,
+ tree optimization,
+ tree target)
{
static int counter = 0;
char which_buf[16];
@@ -862,6 +864,8 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final)
TREE_STATIC (decl) = 1;
TREE_USED (decl) = 1;
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl) = optimization;
+ DECL_FUNCTION_SPECIFIC_TARGET (decl) = target;
DECL_ARTIFICIAL (decl) = 1;
DECL_IGNORED_P (decl) = 1;
DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1;
@@ -911,7 +915,7 @@ cgraph_build_static_cdtor_1 (char which, tree body, int priority, bool final)
void
cgraph_build_static_cdtor (char which, tree body, int priority)
{
- cgraph_build_static_cdtor_1 (which, body, priority, false);
+ cgraph_build_static_cdtor_1 (which, body, priority, false, NULL, NULL);
}
/* When target does not have ctors and dtors, we call all constructor
@@ -993,7 +997,9 @@ build_cdtor (bool ctor_p, const vec<tree> &cdtors)
gcc_assert (body != NULL_TREE);
/* Generate a function to call all the function of like
priority. */
- cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true);
+ cgraph_build_static_cdtor_1 (ctor_p ? 'I' : 'D', body, priority, true,
+ DECL_FUNCTION_SPECIFIC_OPTIMIZATION (cdtors[0]),
+ DECL_FUNCTION_SPECIFIC_TARGET (cdtors[0]));
}
}