This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/66974] -Warray-bounds false positive with -O3
- From: "dj at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Jul 2015 03:06:10 +0000
- Subject: [Bug tree-optimization/66974] -Warray-bounds false positive with -O3
- Auto-submitted: auto-generated
- References: <bug-66974-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66974
DJ Delorie <dj at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dj at redhat dot com
--- Comment #1 from DJ Delorie <dj at redhat dot com> ---
If elsewhere calls foo(500) you will get an actual out of bounds access. I
think the warning is appropriate. Have you tried checking the value of 'order'
in that function, before the loop, to validate its value? Such a check might
fix your bug and silence the warning.