PR sanitizer/77396
commita940fdc7e61a553a4edeb1d9c662980bd864d70f
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Sep 2016 17:11:42 +0000 (2 17:11 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 Sep 2016 17:11:42 +0000 (2 17:11 +0000)
treefbe11b6178ba7e9156879fe0f685cee7e04473c7
parent43b84493a422026fd23bd9ca7aba5c6ea3ed3a27
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239961 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/ipa-pure-const.c
gcc/sanopt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/asan/pr77396.C [new file with mode: 0644]