[Bug sanitizer/60861] out of bounds access of global var in .rodata/.bss not detected
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Apr 17 05:04:00 GMT 2014
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.
More information about the Gcc-bugs
mailing list