public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/55133] New: gcc-4.8-20121028 dubious array bound check
@ 2012-10-30  7:29 nately@t-online.de
  2012-10-30  9:35 ` [Bug tree-optimization/55133] " rguenth at gcc dot gnu.org
  2012-11-02 20:57 ` hubicka at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: nately@t-online.de @ 2012-10-30  7:29 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 55133
           Summary: gcc-4.8-20121028 dubious array bound check
    Classification: Unclassified
           Product: gcc
           Version: tree-ssa
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: nately@t-online.de


Created attachment 28571
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28571
preprocessed file

Please double-check this array out of bound warning with gcc-4.8-20121028: 

./compiler/gcc-4.8.0-snap/bin/gcc c1.c -O3 -c -Wall

c1.c: In function ‘main’:
c1.c:15:22: warning: array subscript is above array bounds
[-Warray-bounds]
           if (!ab_pid[index])
                      ^

extern unsigned char ab_pid_count,old_rfcb_pid_count;
extern unsigned short ab_pid[16];
extern int found_pid;

int main()
{
  unsigned char pid_index = 0;
  int index;

  for (pid_index=0; (pid_index < old_rfcb_pid_count); pid_index++)
    {
      for (index=0; index < ab_pid_count; index++)
        {
          if (!ab_pid[index])
            {
              found_pid = 1;
            }
        };
    }

  return 0;
}

The warning disappear without the outer loop or with ' unsigned short
ab_pid[32]',


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

* [Bug tree-optimization/55133] gcc-4.8-20121028 dubious array bound check
  2012-10-30  7:29 [Bug tree-optimization/55133] New: gcc-4.8-20121028 dubious array bound check nately@t-online.de
@ 2012-10-30  9:35 ` rguenth at gcc dot gnu.org
  2012-11-02 20:57 ` hubicka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-10-30  9:35 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |hubicka at gcc dot gnu.org
         Resolution|                            |DUPLICATE

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-30 09:33:03 UTC ---
dup.

*** This bug has been marked as a duplicate of bug 55079 ***


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

* [Bug tree-optimization/55133] gcc-4.8-20121028 dubious array bound check
  2012-10-30  7:29 [Bug tree-optimization/55133] New: gcc-4.8-20121028 dubious array bound check nately@t-online.de
  2012-10-30  9:35 ` [Bug tree-optimization/55133] " rguenth at gcc dot gnu.org
@ 2012-11-02 20:57 ` hubicka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: hubicka at gcc dot gnu.org @ 2012-11-02 20:57 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #2 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-11-02 20:57:34 UTC ---
Fixed.

*** This bug has been marked as a duplicate of bug 55085 ***


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

end of thread, other threads:[~2012-11-02 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-30  7:29 [Bug tree-optimization/55133] New: gcc-4.8-20121028 dubious array bound check nately@t-online.de
2012-10-30  9:35 ` [Bug tree-optimization/55133] " rguenth at gcc dot gnu.org
2012-11-02 20:57 ` hubicka 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).