This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug sanitizer/60861] out of bounds access of global var in .rodata/.bss not detected
- From: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 17 Apr 2014 05:03:53 +0000
- Subject: [Bug sanitizer/60861] out of bounds access of global var in .rodata/.bss not detected
- Auto-submitted: auto-generated
- References: <bug-60861-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60861
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Yury Gribov from comment #3)
> I can reproduce this in trunk. Looks like Asan pass works correctly but gcc
> reduces test() to 'return 1;' very early for some reason. I'll debug further.
Most likely due to GCC optimizing the code as it knows the only value it could
be is 1. Try it with a two element constant array and you most likely get the
result you want.