diff options
author | Martin Liska <mliska@suse.cz> | 2017-03-06 11:20:33 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-03-06 10:20:33 +0000 |
commit | a50a32aa3cbd139b2fbc56bcd80a82dc7f6ca5e5 (patch) | |
tree | cf302d2f084f1a67fbed6c9139a0cc3263e32f40 /gcc/asan.c | |
parent | 5ada812cedf5c5e4f602c6fc21bfc3744aa2ddcd (diff) | |
download | gcc-a50a32aa3cbd139b2fbc56bcd80a82dc7f6ca5e5.zip gcc-a50a32aa3cbd139b2fbc56bcd80a82dc7f6ca5e5.tar.gz gcc-a50a32aa3cbd139b2fbc56bcd80a82dc7f6ca5e5.tar.bz2 |
Fix ICE in use-after-scope w/ -fno-tree-dce (PR sanitize/79783).
2017-03-06 Martin Liska <mliska@suse.cz>
PR sanitize/79783
* asan.c (asan_expand_poison_ifn): Do not expand ASAN_POISON
when having a SSA NAME w/o VAR_DECL assigned to it.
2017-03-06 Martin Liska <mliska@suse.cz>
PR sanitize/79783
* g++.dg/asan/pr79783.C: New test.
From-SVN: r245912
Diffstat (limited to 'gcc/asan.c')
-rw-r--r-- | gcc/asan.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -3107,12 +3107,16 @@ asan_expand_poison_ifn (gimple_stmt_iterator *iter, { gimple *g = gsi_stmt (*iter); tree poisoned_var = gimple_call_lhs (g); - if (!poisoned_var) + if (!poisoned_var || has_zero_uses (poisoned_var)) { gsi_remove (iter, true); return true; } + if (SSA_NAME_VAR (poisoned_var) == NULL_TREE) + SET_SSA_NAME_VAR_OR_IDENTIFIER (poisoned_var, + create_tmp_var (TREE_TYPE (poisoned_var))); + tree shadow_var = create_asan_shadow_var (SSA_NAME_VAR (poisoned_var), shadow_vars_mapping); |