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)
Confirmed.
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
Tom, could you close if works for you?
This patch works fine for me, thanks!
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