This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/39757] inconsistency in array bounds checking with -O3
- 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, 02 Feb 2012 20:41:15 +0000
- Subject: [Bug middle-end/39757] inconsistency in array bounds checking with -O3
- Auto-submitted: auto-generated
- References: <bug-39757-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39757
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-02-02 20:41:15 UTC ---
We have:
short last[3] = { 16,16,16 }, mul[3], buf[3][3][386];
for (i=0; i < sizeof(buf)/sizeof(short); i++)
buf[0][0][i] = 2048;
Obviously this where one of the warning happens.
Likewise for:
float cfilt=0, ddft[3][3][2], ppm[3][3][3];
>For one, the compiler considers it an issues that array cam_xyz[4][3] is
accessed as cam_xyz[0][j], 0 <= j < 12. This issue is found with -O3 but not
with -O2.
That warning is correct. Now for the other part, this warning really depends
on optimization and is not always 100% of producing all the warnings it could.