http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49657

           Summary: array subscript warnings when building gcc with -O2
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: dirtye...@gentoo.org


Building gcc-4.6.1 with BOOT_CFLAGS="-O2" causes a couple -Warray-bounds
warnings to be output.  I know there are several PRs open for bogus "above
array bounds" warnings but since these are triggered building GCC itself I
thought I'd report them.  There is also a "below array bounds" warning.

The warnings also appear in 4.6.0 but not 4.5.* IIRC.

~/gcc/gcc-4.6.1 $ ./configure --enable-languages=c
~/gcc/gcc-4.6.1 $ make BOOT_CFLAGS="-O2" bootstrap-lean


../../.././libgcc/../gcc/crtstuff.c: In function ‘frame_dummy’:
../../.././libgcc/../gcc/crtstuff.c:381:19: warning: array subscript is above
array bounds [-Warray-bounds]

../../.././libgcc/../gcc/crtstuff.c: In function ‘__do_global_ctors_aux’:
../../.././libgcc/../gcc/crtstuff.c:575:25: warning: array subscript is below
array bounds [-Warray-bounds]

../.././gcc/expmed.c: In function ‘init_expmed’:
../.././gcc/expmed.c:134:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:141:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:145:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:149:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:153:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:157:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:164:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:180:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:184:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:188:3: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:231:8: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:246:8: warning: array subscript is above array bounds
[-Warray-bounds]
../.././gcc/expmed.c:247:8: warning: array subscript is above array bounds
[-Warray-bounds]

Reply via email to