public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/48795] New: -Warray-bounds false positive
@ 2011-04-27 23:41 niko.lecam at gmail dot com
  2011-04-27 23:43 ` [Bug tree-optimization/48795] " niko.lecam at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: niko.lecam at gmail dot com @ 2011-04-27 23:41 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: -Warray-bounds false positive
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: niko.lecam@gmail.com


$ gcc -v
Utilisation des specs internes.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configuré avec: /build/src/gcc-4.6-20110415/configure --prefix=/usr
--libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/
--enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared
--enable-threads=posix --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-clocale=gnu --enable-gnu-unique-object
--enable-linker-build-id --with-ppl --enable-cloog-backend=isl --enable-lto
--enable-gold --enable-ld=default --enable-plugin --with-plugin-ld=ld.gold
--enable-multilib --disable-libstdcxx-pch --enable-checking=release
Modèle de thread: posix
gcc version 4.6.0 20110415 (prerelease) (GCC)

$ cat t.c 
/* testcase (derived from wine) */
typedef struct
{
  int len;
  char data[1];
} rec;

int
p(rec *r, int len);

int
f (char prm1, char prm2)
{
  char buf[10];

  rec *r1 = (rec *)&buf;

  r1->len = 10;
  r1->data[0] = prm1;
  r1->data[1] = prm2;

  return p(r1, r1->len);
}

$ gcc -S -O2 -Wall t.c -save-temps
t.c: In function ‘f’:
t.c:19:11: attention : array subscript is above array bounds [-Warray-bounds]


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

end of thread, other threads:[~2011-07-24 21:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-27 23:41 [Bug tree-optimization/48795] New: -Warray-bounds false positive niko.lecam at gmail dot com
2011-04-27 23:43 ` [Bug tree-optimization/48795] " niko.lecam at gmail dot com
2011-05-01  7:29 ` d.g.gorbachev at gmail dot com
2011-05-01 10:27 ` niko.lecam at gmail dot com
2011-07-23 22:57 ` pinskia at gcc dot gnu.org
2011-07-24 21:04 ` pinskia 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).