https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83038
Bug ID: 83038
Summary: [8 regression] warning at random points in the input
(array subscript -1 is below array bounds)
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: regression
Assignee: unassigned at gcc dot gnu.org
Reporter: gerald at pfeifer dot com
CC: dmalcolm at redhat dot com, msebor at gcc dot gnu.org,
polacek at redhat dot com
Target Milestone: ---
Created attachment 42641
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42641&action=edit
Testcase
A couple of days the attached testcase started issuing a new warning
which is actually wrong -- or at least points to a completely bogus
location.
In fact, trying to trim this down, the message started pointing to a
different location, until I reached a case which definitely makes no
sense at all:
gcc -c -o config.o -O2 -g -Wall c2.i
config.c: In function ‘ConfigureDevicesDlgProc’:
config.c:132:29: warning: array subscript -1 is below array bounds of
‘DIDEVICEOBJECTINSTANCEW[256] {aka struct DIDEVICEOBJECTINSTANCEW[256]}’
[-Warray-bounds]
/* Keep the action and text in the listview item */
^~~
This was on an i386-unknown-freebsd10 system, but compiling the testcase
on amd64-unknown-freebsd11 I got the same (at a different location).
(This is from Wine, where I build the latest git code nightly with the
latest version of GCC head.)