This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/66422] -Warray-bounds false positive with -O3
- From: "gajjanagadde at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 04 Jun 2015 22:16:51 +0000
- Subject: [Bug c/66422] -Warray-bounds false positive with -O3
- Auto-submitted: auto-generated
- References: <bug-66422-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66422
--- Comment #2 from Ganesh Ajjanagadde <gajjanagadde at gmail dot com> ---
But myfoo->foo_size is not set within the foo_loop function.
For instance, myfoo->foo_size could be set outside the function boundary,
and then the function could be called (say foo_size = 3 or 4).
This is represented by the get_foo() function.
Then, as long as the programmer guarantees that when this function is called,
myfoo->foo_size is always <= 4, there is certainly no error.
Furthermore, note that I put a < 3 condition as opposed to a <= 3.