This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/55079] [4.8 regression] false positive -Warray-bounds (also seen at -O3 bootstrap)
- From: "hubicka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Nov 2012 01:01:30 +0000
- Subject: [Bug tree-optimization/55079] [4.8 regression] false positive -Warray-bounds (also seen at -O3 bootstrap)
- Auto-submitted: auto-generated
- References: <bug-55079-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55079
--- Comment #9 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-15 01:01:30 UTC ---
This is reduced testcase from gcov.c
int a[8];
int
t (void)
{
int ix = 0;
int k;
int b = 0;
int curr = 0;
for (k = 0; k < 2; k++)
{
b = ix * 32;
curr = a[ix++];
if (!(ix <= 8))
abort ();
while (curr)
{
b = ix * 32;
curr = a[ix++];
if (!(ix <= 8))
abort ();
}
}
return curr + b;
}
jan@linux-e0ml:~/trunk/build/gcc> ./xgcc -B ./ -O2 -fprofile-use t.c
-Warray-bounds -S -S -fdump-tree-cunroll-details -fdump-tree-all-details
t.c: In function âtâ:
t.c:14:2: warning: incompatible implicit declaration of built-in function
âabortâ [enabled by default]
abort ();
^
t.c:25:1: note: file /home/jan/trunk/build/gcc/t.gcda not found, execution
counts estimated
}
^
t.c:19:15: warning: array subscript is above array bounds [-Warray-bounds]
curr = a[ix++];
^
t.c:19:15: warning: array subscript is above array bounds [-Warray-bounds]
Obivously here unroller does not know that bv_ix is at least 1