public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39809]  New: emit-rtl.c:608(-> gen_rtx_REG): warning: array subscript is above array bounds
@ 2009-04-18 20:51 jbglaw at lug-owl dot de
  2009-04-21 18:03 ` [Bug middle-end/39809] " pinskia at gcc dot gnu dot org
  2009-04-21 21:33 ` jbglaw at lug-owl dot de
  0 siblings, 2 replies; 3+ messages in thread
From: jbglaw at lug-owl dot de @ 2009-04-18 20:51 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2287 bytes --]

While mass-building cross-compilers, I got this warning:

$ ./configure --target v850e-linux --prefix
/home/jbglaw/devel/build-temp-v850e-linux/usr --enable-languages=c,c++
--disable-libc --disable-libmudflap --disable-libssp --disable-multilib
--disable-shared --enable-static --with-system-zlib --enable-threads
$ make all-gcc
gcc -c  -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wwrite-strings
-Wstrict-prototypes -Wmissing-prototypes -Wcast-qual -Wold-style-definition
-Wc++-compat -Wmissing-format-attribute -pedantic -Wno-long-long
-Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I.
-I. -I/home/jbglaw/devel/sources/gcc/gcc -I/home/jbglaw/devel/sources/gcc/gcc/.
-I/home/jbglaw/devel/sources/gcc/gcc/../include
-I/home/jbglaw/devel/sources/gcc/gcc/../libcpp/include 
-I/home/jbglaw/devel/sources/gcc/gcc/../libdecnumber
-I/home/jbglaw/devel/sources/gcc/gcc/../libdecnumber/dpd -I../libdecnumber   
/home/jbglaw/devel/sources/gcc/gcc/emit-rtl.c -o emit-rtl.o
/home/jbglaw/devel/sources/gcc/gcc/emit-rtl.c: In function ‘gen_rtx_REG’:
/home/jbglaw/devel/sources/gcc/gcc/emit-rtl.c:608: warning: array subscript is
above array bounds

emit-rtl.c:
 608       if (regno == (unsigned) PIC_OFFSET_TABLE_REGNUM
 609           && fixed_regs[PIC_OFFSET_TABLE_REGNUM])
 610         return pic_offset_table_rtx;

$ grep PIC_OFFSET_TABLE_REGNUM config/v850/*
$ 

$ grep PIC_OFFSET_TABLE_REGNUM defaults.h 
#ifndef PIC_OFFSET_TABLE_REGNUM
#define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM

$ grep INVALID_REGNUM rtl.h 
#define INVALID_REGNUM                  (~(unsigned int) 0)

Other targets triggering this warning:
$ zgrep gen_rtx_REG *.log.gz|cut -f 1 -d .
avr-linux
frv-linux
h8300-elf
v850e-linux
vax-linux
xtensa-linux


-- 
           Summary: emit-rtl.c:608(-> gen_rtx_REG): warning: array subscript
                    is above array bounds
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jbglaw at lug-owl dot de
 GCC build triplet: i686-linux
  GCC host triplet: i686-linux
GCC target triplet: v850e-linux


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


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

* [Bug middle-end/39809] emit-rtl.c:608(-> gen_rtx_REG): warning: array subscript is above array bounds
  2009-04-18 20:51 [Bug c/39809] New: emit-rtl.c:608(-> gen_rtx_REG): warning: array subscript is above array bounds jbglaw at lug-owl dot de
@ 2009-04-21 18:03 ` pinskia at gcc dot gnu dot org
  2009-04-21 21:33 ` jbglaw at lug-owl dot de
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-04-21 18:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-04-21 18:02 -------
This warning is correct but incorrect as this code can never be invoked unless
there is a huge bug inside GCC but GCC's warning system does not know that.

What version of GCC are you using to build the cross compilers, 4.5.0?


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |middle-end


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


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

* [Bug middle-end/39809] emit-rtl.c:608(-> gen_rtx_REG): warning: array subscript is above array bounds
  2009-04-18 20:51 [Bug c/39809] New: emit-rtl.c:608(-> gen_rtx_REG): warning: array subscript is above array bounds jbglaw at lug-owl dot de
  2009-04-21 18:03 ` [Bug middle-end/39809] " pinskia at gcc dot gnu dot org
@ 2009-04-21 21:33 ` jbglaw at lug-owl dot de
  1 sibling, 0 replies; 3+ messages in thread
From: jbglaw at lug-owl dot de @ 2009-04-21 21:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jbglaw at lug-owl dot de  2009-04-21 21:32 -------
This is SVN trunk, fetched via GIT. With my last build, it was SVN rev 146349
which produces the warnings. At this point I also just realize that it might be
a nice thing to actually print out the array bounds as well as the current
(maligne) index that GCC warns about.


-- 


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


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

end of thread, other threads:[~2009-04-21 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-18 20:51 [Bug c/39809] New: emit-rtl.c:608(-> gen_rtx_REG): warning: array subscript is above array bounds jbglaw at lug-owl dot de
2009-04-21 18:03 ` [Bug middle-end/39809] " pinskia at gcc dot gnu dot org
2009-04-21 21:33 ` jbglaw at lug-owl dot de

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).