Bug 61897 - sanitizer internal compiler error: in build2_stat, at tree.c:4160
Summary: sanitizer internal compiler error: in build2_stat, at tree.c:4160
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: sanitizer (show other bugs)
Version: 4.9.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-24 17:21 UTC by Tom Truscott
Modified: 2014-10-16 13:54 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-07-24 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Truscott 2014-07-24 17:21:04 UTC
gcc -c foo.c -fsanitize=address
foo.c: In function âisfooâ:
foo.c:3:5: internal compiler error: in build2_stat, at tree.c:4160

foo.c is

//#include <string.h>
int isfoo(char *s) { return memcmp(s, "foo", 3) == 0; }

gcc -v reports:

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/c/bb04na1a/vol/sas3rd/wky/mva-v940/lax/gcc/gcc-4.9.1/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.9.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/sas3rd/wky/mva-v940/lax/gcc/gcc-4.9.1 --enable-languages=c,c++,fortran
Thread model: posix
gcc version 4.9.1 (GCC)
Comment 1 Marek Polacek 2014-07-24 17:31:46 UTC
Confirmed.
Comment 2 Yury Gribov 2014-09-01 07:48:11 UTC
Author: ygribov
Date: Mon Sep  1 07:47:37 2014
New Revision: 214777

URL: https://gcc.gnu.org/viewcvs?rev=214777&root=gcc&view=rev
Log:
2014-09-01  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/61897
	PR sanitizer/62140

gcc/
	* asan.c (asan_mem_ref_get_end): Handle non-ptroff_t lengths.
	(build_check_stmt): Likewise.
	(instrument_strlen_call): Likewise.
	(asan_expand_check_ifn): Likewise and fix types.
	(maybe_cast_to_ptrmode): New function.

gcc/testsuite/
	* c-c++-common/asan/pr62140-1.c: New test.
	* c-c++-common/asan/pr62140-2.c: New test.

Added:
    trunk/gcc/testsuite/c-c++-common/asan/pr62140-1.c
    trunk/gcc/testsuite/c-c++-common/asan/pr62140-2.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/asan.c
    trunk/gcc/testsuite/ChangeLog
Comment 3 Yury Gribov 2014-09-08 07:30:31 UTC
Tom, could you close if works for you?
Comment 4 Tom Truscott 2014-09-09 13:31:18 UTC
This patch works fine for me, thanks!
Comment 5 Yury Gribov 2014-10-16 13:54:04 UTC
Author: ygribov
Date: Thu Oct 16 13:53:33 2014
New Revision: 216332

URL: https://gcc.gnu.org/viewcvs?rev=216332&root=gcc&view=rev
Log:
2014-10-16  Yury Gribov  <y.gribov@samsung.com>

	Backport from mainline
	2014-09-01  Yury Gribov  <y.gribov@samsung.com>

	PR sanitizer/61897
	PR sanitizer/62140

	* asan.c (asan_mem_ref_get_end): Handle non-ptroff_t lengths.
	(build_check_stmt): Likewise.
	(instrument_strlen_call): Likewise.
	(asan_expand_check_ifn): Likewise and fix types.
	(maybe_cast_to_ptrmode): New function.

	* c-c++-common/asan/pr62140-1.c: New test.
	* c-c++-common/asan/pr62140-2.c: New test.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/c-c++-common/asan/pr62140-1.c
    branches/gcc-4_9-branch/gcc/testsuite/c-c++-common/asan/pr62140-2.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/asan.c
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog