===================================================================
@@ -914,7 +914,14 @@ cgraph_build_static_cdtor_1 (char which,
void
cgraph_build_static_cdtor (char which, tree body, int priority)
{
- cgraph_build_static_cdtor_1 (which, body, priority, false, NULL, NULL);
+ /* FIXME: We should be able to
+ gcc_assert (!in_lto_p);
+ because at LTO time the global options are not safe to use.
+ Unfortunately ASAN finish_file will produce constructors late and they
+ may lead to surprises. */
+ cgraph_build_static_cdtor_1 (which, body, priority, false,
+ optimization_default_node,
+ target_option_default_node);
}
/* When target does not have ctors and dtors, we call all constructor