[Bug sanitizer/77396] address sanitizer crashes if all static global variables are optimized
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 2 17:12:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77396
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Sep 2 17:11:42 2016
New Revision: 239961
URL: https://gcc.gnu.org/viewcvs?rev=239961&root=gcc&view=rev
Log:
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.
Added:
trunk/gcc/testsuite/g++.dg/asan/pr77396.C
Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/decl2.c
trunk/gcc/ipa-pure-const.c
trunk/gcc/sanopt.c
trunk/gcc/testsuite/ChangeLog
More information about the Gcc-bugs
mailing list