This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/55133] New: gcc-4.8-20121028 dubious array bound check
- From: "nately at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Oct 2012 07:29:43 +0000
- Subject: [Bug tree-optimization/55133] New: gcc-4.8-20121028 dubious array bound check
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55133
Bug #: 55133
Summary: gcc-4.8-20121028 dubious array bound check
Classification: Unclassified
Product: gcc
Version: tree-ssa
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: nately@t-online.de
Created attachment 28571
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28571
preprocessed file
Please double-check this array out of bound warning with gcc-4.8-20121028:
./compiler/gcc-4.8.0-snap/bin/gcc c1.c -O3 -c -Wall
c1.c: In function âmainâ:
c1.c:15:22: warning: array subscript is above array bounds
[-Warray-bounds]
if (!ab_pid[index])
^
extern unsigned char ab_pid_count,old_rfcb_pid_count;
extern unsigned short ab_pid[16];
extern int found_pid;
int main()
{
unsigned char pid_index = 0;
int index;
for (pid_index=0; (pid_index < old_rfcb_pid_count); pid_index++)
{
for (index=0; index < ab_pid_count; index++)
{
if (!ab_pid[index])
{
found_pid = 1;
}
};
}
return 0;
}
The warning disappear without the outer loop or with ' unsigned short
ab_pid[32]',