diff options
author | Martin Liska <mliska@suse.cz> | 2017-01-23 13:02:13 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-01-23 12:02:13 +0000 |
commit | c7775327e8cf214872b3d179bfaa1b441759ab5a (patch) | |
tree | 1ab9205a738735b127304a898b222670154c0f01 /gcc/sanopt.c | |
parent | 913e4b3617fe7f46fbdbb72b010cf6cf7201d329 (diff) | |
download | gcc-c7775327e8cf214872b3d179bfaa1b441759ab5a.zip gcc-c7775327e8cf214872b3d179bfaa1b441759ab5a.tar.gz gcc-c7775327e8cf214872b3d179bfaa1b441759ab5a.tar.bz2 |
Speed up use-after-scope (v2): rewrite into SSA
2017-01-23 Martin Liska <mliska@suse.cz>
* asan.c (create_asan_shadow_var): New function.
(asan_expand_poison_ifn): Likewise.
* asan.h (asan_expand_poison_ifn): New declaration.
* internal-fn.c (expand_ASAN_POISON): Likewise.
* internal-fn.def (ASAN_POISON): New builtin.
* sanopt.c (pass_sanopt::execute): Expand
asan_expand_poison_ifn.
* tree-inline.c (copy_decl_for_dup_finish): Make function
external.
* tree-inline.h (copy_decl_for_dup_finish): Likewise.
* tree-ssa.c (is_asan_mark_p): New function.
(execute_update_addresses_taken): Rewrite local variables
(identified just by use-after-scope as addressable) into SSA.
2017-01-23 Martin Liska <mliska@suse.cz>
* gcc.dg/asan/use-after-scope-3.c: Add additional flags.
* gcc.dg/asan/use-after-scope-9.c: Likewise and grep for
sanopt optimization for ASAN_POISON.
From-SVN: r244791
Diffstat (limited to 'gcc/sanopt.c')
-rw-r--r-- | gcc/sanopt.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/sanopt.c b/gcc/sanopt.c index 55e07c0..70b7aeb 100644 --- a/gcc/sanopt.c +++ b/gcc/sanopt.c @@ -894,6 +894,8 @@ pass_sanopt::execute (function *fun) bool use_calls = ASAN_INSTRUMENTATION_WITH_CALL_THRESHOLD < INT_MAX && asan_num_accesses >= ASAN_INSTRUMENTATION_WITH_CALL_THRESHOLD; + hash_map<tree, tree> shadow_vars_mapping; + bool need_commit_edge_insert = false; FOR_EACH_BB_FN (bb, fun) { gimple_stmt_iterator gsi; @@ -931,6 +933,11 @@ pass_sanopt::execute (function *fun) case IFN_ASAN_MARK: no_next = asan_expand_mark_ifn (&gsi); break; + case IFN_ASAN_POISON: + no_next = asan_expand_poison_ifn (&gsi, + &need_commit_edge_insert, + shadow_vars_mapping); + break; default: break; } @@ -962,6 +969,10 @@ pass_sanopt::execute (function *fun) gsi_next (&gsi); } } + + if (need_commit_edge_insert) + gsi_commit_edge_inserts (); + return 0; } |