summaryrefslogtreecommitdiff
path: root/gcc/sanopt.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-05 23:00:09 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-12-05 23:00:09 +0000
commit661191fdd5da7e4d6d643ed7f5b0dda050c2e7f0 (patch)
treea6aec67162141abb0a0ec3158b81ddd7c15b82fe /gcc/sanopt.c
parent086624e6b29456930ff8b5b6b475d815ecfc4975 (diff)
downloadgcc-661191fdd5da7e4d6d643ed7f5b0dda050c2e7f0.tar.gz
PR sanitizer/64170
* sanopt.c (maybe_optimize_asan_check_ifn): If base_checks is non-NULL, call maybe_get_dominating_check on it even if g is non-NULL. * gcc.dg/asan/pr64170.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218440 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/sanopt.c')
-rw-r--r--gcc/sanopt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/sanopt.c b/gcc/sanopt.c
index e0d3a8562b3..ce9fbcf604a 100644
--- a/gcc/sanopt.c
+++ b/gcc/sanopt.c
@@ -408,12 +408,13 @@ maybe_optimize_asan_check_ifn (struct sanopt_ctx *ctx, gimple stmt)
}
gimple g = maybe_get_dominating_check (*ptr_checks);
+ gimple g2 = NULL;
- if (!g && base_checks)
+ if (base_checks)
/* Try with base address as well. */
- g = maybe_get_dominating_check (*base_checks);
+ g2 = maybe_get_dominating_check (*base_checks);
- if (!g)
+ if (g == NULL && g2 == NULL)
{
/* For this PTR we don't have any ASAN_CHECK stmts recorded, so there's
nothing to optimize yet. */