public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vapier at gentoo dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c/53198] New: [4.6 Regression] gcc wrongly emits "array subscript is above array bounds" for simple arrays Date: Wed, 02 May 2012 18:35:00 -0000 [thread overview] Message-ID: <bug-53198-4@http.gcc.gnu.org/bugzilla/> (raw) 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.
next reply other threads:[~2012-05-02 18:35 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-05-02 18:35 vapier at gentoo dot org [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-53198-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).