public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/53198] New: [4.6 Regression] gcc wrongly emits "array subscript is above array bounds" for simple arrays
@ 2012-05-02 18:35 vapier at gentoo dot org
  2012-05-02 19:06 ` [Bug c/53198] " manu at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: vapier at gentoo dot org @ 2012-05-02 18:35 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 53198
           Summary: [4.6 Regression] gcc wrongly emits "array subscript is
                    above array bounds" for simple arrays
    Classification: Unclassified
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vapier@gentoo.org
                CC: toolchain@gentoo.org
            Target: x86_64-linux-gnu


simple code that processes arrays based on NULL terminator rather than
ARRAY_SIZE

$ cat test.c
void *devices[] = { 0, };
int main()
{
        int i;
        for (i = 0; devices[i]; i++)
                ;
        return 0;
}

$ gcc -Warray-bounds -O2 test.c 
test.c: In function 'main':
test.c:5:21: warning: array subscript is above array bounds [-Warray-bounds]

looks like it started failing with 4.6.0 ... older versions are fine.


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

end of thread, other threads:[~2014-06-12 13:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-02 18:35 [Bug c/53198] New: [4.6 Regression] gcc wrongly emits "array subscript is above array bounds" for simple arrays vapier at gentoo dot org
2012-05-02 19:06 ` [Bug c/53198] " manu at gcc dot gnu.org
2012-05-03 10:47 ` [Bug tree-optimization/53198] [4.6/4.7 " rguenth at gcc dot gnu.org
2012-05-29 14:33 ` rguenth at gcc dot gnu.org
2012-07-16  7:28 ` Petr.Salinger at seznam dot cz
2012-10-23 22:33 ` manu at gcc dot gnu.org
2012-12-18 15:16 ` rguenth at gcc dot gnu.org
2013-04-12 15:16 ` [Bug tree-optimization/53198] [4.7 " jakub at gcc dot gnu.org
2013-10-14 10:14 ` Emmanuel.Thome at inria dot fr
2013-10-14 10:43 ` paolo.carlini at oracle dot com
2014-06-12 13:07 ` 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).