public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/52588] New: false warning: array subscript is above array bounds: number of elements is 1
@ 2012-03-14 15:46 dmagagnosc at yahoo dot com
  2012-03-15  9:02 ` [Bug tree-optimization/52588] " pinskia at gcc dot gnu.org
  2012-12-18 15:19 ` rguenth at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: dmagagnosc at yahoo dot com @ 2012-03-14 15:46 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52588
           Summary: false warning: array subscript is above array bounds:
                    number of elements is 1
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dmagagnosc@yahoo.com


Created attachment 26892
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=26892
Preprocessed source file

Using built-in specs.
COLLECT_GCC=gcc-4.6
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin
--enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-c' '-g3' '-O3' '-o' 'OOB.o'
'-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/4.6.1/cc1 -E -quiet -v -imultilib . -imultiarch
x86_64-linux-gnu -dD OOB.c -mtune=generic -march=x86-64 -Wall -g3
-fworking-directory -O3 -fpch-preprocess -fstack-protector -o OOB.i
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/4.6.1/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.6.1/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-c' '-g3' '-O3' '-o' 'OOB.o'
'-mtune=generic' '-march=x86-64'
 /usr/lib/gcc/x86_64-linux-gnu/4.6.1/cc1 -fpreprocessed OOB.i -quiet -dumpbase
OOB.c -mtune=generic -march=x86-64 -auxbase-strip OOB.o -g3 -O3 -Wall -version
-fstack-protector -o OOB.s
GNU C (Ubuntu/Linaro 4.6.1-9ubuntu3) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version
3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C (Ubuntu/Linaro 4.6.1-9ubuntu3) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version
3.0.1-p3, MPC version 0.9
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 5dede901e38d49932d3155c3e888bca1
OOB.c: In function ‘func’:
OOB.c:20:25: warning: array subscript is above array bounds [-Warray-bounds]
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-c' '-g3' '-O3' '-o' 'OOB.o'
'-mtune=generic' '-march=x86-64'
 as --64 -o OOB.o OOB.s
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-Wall' '-c' '-g3' '-O3' '-o' 'OOB.o'
'-mtune=generic' '-march=x86-64'


Notes:
1) Changing the second dimension to 2 avoids the warning.
2) Compiles correctly with GCC 4.4.6.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/52588] false warning: array subscript is above array bounds: number of elements is 1
  2012-03-14 15:46 [Bug c/52588] New: false warning: array subscript is above array bounds: number of elements is 1 dmagagnosc at yahoo dot com
@ 2012-03-15  9:02 ` pinskia at gcc dot gnu.org
  2012-12-18 15:19 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-03-15  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-03-15 08:58:14 UTC ---
I don't think there is a way for the compiler to see if idx_5 is within the
range of [0, 9].  So we are warning for the cases where idx_5 is out of the
range really.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug tree-optimization/52588] false warning: array subscript is above array bounds: number of elements is 1
  2012-03-14 15:46 [Bug c/52588] New: false warning: array subscript is above array bounds: number of elements is 1 dmagagnosc at yahoo dot com
  2012-03-15  9:02 ` [Bug tree-optimization/52588] " pinskia at gcc dot gnu.org
@ 2012-12-18 15:19 ` rguenth at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-12-18 15:19 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.8.0

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> 2012-12-18 15:19:01 UTC ---
Fixed for 4.8.0.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-18 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-14 15:46 [Bug c/52588] New: false warning: array subscript is above array bounds: number of elements is 1 dmagagnosc at yahoo dot com
2012-03-15  9:02 ` [Bug tree-optimization/52588] " pinskia at gcc dot gnu.org
2012-12-18 15:19 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).