public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/64739] New: Spurious "array subscript is above array bounds" warning
@ 2015-01-23  7:39 siddhesh at redhat dot com
  2015-01-23 19:15 ` [Bug tree-optimization/64739] " rth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: siddhesh at redhat dot com @ 2015-01-23  7:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64739

            Bug ID: 64739
           Summary: Spurious "array subscript is above array bounds"
                    warning
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: siddhesh at redhat dot com

Reduced Reproducer:

$ cat foo.c
void
foo (char **inptrp, char *inend, int *wch, int *cnt)
{ 
  int inlen = *cnt & 7;
  if (inlen != 0)
    { 
      char *inptr = *inptrp;
      char bytebuf[4];

      while (inptr < inend)
        bytebuf[inlen++] = *inptr++;

      *cnt = &bytebuf[inlen] - inptr;
      *wch = *inptr;
    }
}

$ gcc -O3 -Wall -o foo.s -S foo.c
foo.c: In function ‘foo’:
foo.c:11:16: warning: array subscript is above array bounds [-Warray-bounds]
         bytebuf[inlen++] = *inptr++;
                ^

The warning disappears when one adds -fno-tree-vrp to the compile command.

The actual error appears when building the iconv bits in glibc.
>From gcc-bugs-return-474491-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jan 23 08:13:57 2015
Return-Path: <gcc-bugs-return-474491-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18486 invoked by alias); 23 Jan 2015 08:13:51 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 18113 invoked by uid 48); 23 Jan 2015 08:13:28 -0000
From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/64712] [5 Regression] FAIL: gnat.dg/unchecked_convert1.adb execution test (x86_64/-m32)
Date: Fri, 23 Jan 2015 08:13:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: ada
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ebotcazou at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on everconfirmed
Message-ID: <bug-64712-4-9G61GWvl74@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-64712-4@http.gcc.gnu.org/bugzilla/>
References: <bug-64712-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-01/txt/msg02485.txt.bz2
Content-length: 512

https://gcc.gnu.org/bugzilla/show_bug.cgi?idd712

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|2015-01-22 00:00:00         |2015-01-23
     Ever confirmed|0                           |1

--- Comment #7 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
It's an uninitialized local variable.


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

* [Bug tree-optimization/64739] Spurious "array subscript is above array bounds" warning
  2015-01-23  7:39 [Bug tree-optimization/64739] New: Spurious "array subscript is above array bounds" warning siddhesh at redhat dot com
@ 2015-01-23 19:15 ` rth at gcc dot gnu.org
  2015-01-26 13:07 ` izamyatin at gmail dot com
  2015-01-28 22:15 ` rth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rth at gcc dot gnu.org @ 2015-01-23 19:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64739

Richard Henderson <rth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-01-23
                 CC|                            |rth at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Henderson <rth at gcc dot gnu.org> ---
This seems to be related to induction variable elimination in some way,
because the VR for the offending unrolled iteration is [4,10].

Which is clearly silly.


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

* [Bug tree-optimization/64739] Spurious "array subscript is above array bounds" warning
  2015-01-23  7:39 [Bug tree-optimization/64739] New: Spurious "array subscript is above array bounds" warning siddhesh at redhat dot com
  2015-01-23 19:15 ` [Bug tree-optimization/64739] " rth at gcc dot gnu.org
@ 2015-01-26 13:07 ` izamyatin at gmail dot com
  2015-01-28 22:15 ` rth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: izamyatin at gmail dot com @ 2015-01-26 13:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64739

Igor Zamyatin <izamyatin at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |izamyatin at gmail dot com

--- Comment #2 from Igor Zamyatin <izamyatin at gmail dot com> ---
Looks quite similar to PR64277


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

* [Bug tree-optimization/64739] Spurious "array subscript is above array bounds" warning
  2015-01-23  7:39 [Bug tree-optimization/64739] New: Spurious "array subscript is above array bounds" warning siddhesh at redhat dot com
  2015-01-23 19:15 ` [Bug tree-optimization/64739] " rth at gcc dot gnu.org
  2015-01-26 13:07 ` izamyatin at gmail dot com
@ 2015-01-28 22:15 ` rth at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rth at gcc dot gnu.org @ 2015-01-28 22:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64739

Richard Henderson <rth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Richard Henderson <rth at gcc dot gnu.org> ---
Yes indeed, this does seem to have been fixed along with 64277.

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


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

end of thread, other threads:[~2015-01-28 22:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-23  7:39 [Bug tree-optimization/64739] New: Spurious "array subscript is above array bounds" warning siddhesh at redhat dot com
2015-01-23 19:15 ` [Bug tree-optimization/64739] " rth at gcc dot gnu.org
2015-01-26 13:07 ` izamyatin at gmail dot com
2015-01-28 22:15 ` rth 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).