aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2019-11-13 10:05:14 +0100
committerJan Hubicka <hubicka@gcc.gnu.org>2019-11-13 09:05:14 +0000
commitd4b44b834e3ac1b92ffb165e7bdaf641a211c34b (patch)
tree0c66c77793960a0e851bba275f631581c0dc0749 /gcc/ipa.c
parente4020b28d02a00d478a3a769855ae6a8d9cc6b26 (diff)
downloadgcc-d4b44b834e3ac1b92ffb165e7bdaf641a211c34b.zip
gcc-d4b44b834e3ac1b92ffb165e7bdaf641a211c34b.tar.gz
gcc-d4b44b834e3ac1b92ffb165e7bdaf641a211c34b.tar.bz2
ipa.c (cgraph_build_static_cdtor): Pass optimization_default_node and target_option_default_node to get...
* ipa.c (cgraph_build_static_cdtor): Pass optimization_default_node and target_option_default_node to get -fprofile-generate ctors working right with LTO. From-SVN: r278123
Diffstat (limited to 'gcc/ipa.c')
-rw-r--r--gcc/ipa.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ipa.c b/gcc/ipa.c
index 934e497..0c92980 100644
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -914,7 +914,14 @@ 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, 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