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.
From-SVN: r218440
+2014-12-05 Jakub Jelinek <jakub@redhat.com>
+
+ 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.
+
2014-12-05 Jeff Law <law@redhat.com>
* doc/md.texi: Note problems using function calls to determine
}
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. */
+2014-12-05 Jakub Jelinek <jakub@redhat.com>
+
+ PR sanitizer/64170
+ * gcc.dg/asan/pr64170.c: New test.
+
2014-12-05 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/53199
--- /dev/null
+/* PR sanitizer/64170 */
+/* { dg-do compile } */
+/* { dg-options "-fsanitize=address,null" } */
+
+int a, *b, c;
+void bar (int);
+
+void
+foo (void)
+{
+ char *d = (char *) b;
+ if (d[0] && d[1])
+ return;
+ if (c)
+ a = *(int *) d;
+ bar (*(int *) d);
+}