re PR sanitizer/77396 (address sanitizer crashes if all static global variables...
authorJakub Jelinek <jakub@gcc.gnu.org>
Fri, 2 Sep 2016 17:11:42 +0000 (19:11 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 2 Sep 2016 17:11:42 +0000 (19:11 +0200)
commit94087e88e0fcd45e51ab5797406714048dd5334c
treefbe11b6178ba7e9156879fe0f685cee7e04473c7
parentaf711c232d854adacd147897c1886cadeb4391f2
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
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]