+2018-12-15 Jan Hubicka <hubicka@ucw.cz>
+
+ * 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.
+
2018-12-15 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.c (generate_set_vrsave, rs6000_emit_savres_rtx),
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];
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;
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
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]));
}
}