re PR sanitizer/64170 (ICE compiling Linux Kernel drivers/media/rc/imon.c in imon_incoming_packet)

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
This commit is contained in:
Jakub Jelinek 2014-12-06 00:00:09 +01:00 committed by Jakub Jelinek
parent 40da08e0dd
commit 06dd2aceb1
4 changed files with 33 additions and 3 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -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. */

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,17 @@
/* 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);
}