summaryrefslogtreecommitdiff
path: root/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2016-09-02 19:11:42 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-09-02 19:11:42 +0200
commit94087e88e0fcd45e51ab5797406714048dd5334c (patch)
treefbe11b6178ba7e9156879fe0f685cee7e04473c7 /gcc/ipa-pure-const.c
parentaf711c232d854adacd147897c1886cadeb4391f2 (diff)
re PR sanitizer/77396 (address sanitizer crashes if all static global variables are optimized)
PR sanitizer/77396 * sanopt.c: Include gimple-ssa.h, tree-phinodes.h and ssa-iterators.h. (sanopt_optimize_walker): Optimize away __asan_before_dynamic_init (...) followed by __asan_after_dynamic_init () without intervening memory loads/stores. * ipa-pure-const.c (special_builtin_state): Handle BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT and BUILT_IN_ASAN_AFTER_DYNAMIC_INIT. * decl2.c (do_static_initialization_or_destruction): Only call asan_dynamic_init_call if INITP is true. * g++.dg/asan/pr77396.C: New test. From-SVN: r239961
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r--gcc/ipa-pure-const.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index a9570e4aa6c..9732cbff12e 100644
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -508,6 +508,8 @@ special_builtin_state (enum pure_const_state_e *state, bool *looping,
case BUILT_IN_FRAME_ADDRESS:
case BUILT_IN_APPLY:
case BUILT_IN_APPLY_ARGS:
+ case BUILT_IN_ASAN_BEFORE_DYNAMIC_INIT:
+ case BUILT_IN_ASAN_AFTER_DYNAMIC_INIT:
*looping = false;
*state = IPA_CONST;
return true;