public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/43833]  New: false warning: array subscript is above array bounds with -O3
@ 2010-04-21 14:10 jiez at gcc dot gnu dot org
  2010-04-21 14:49 ` [Bug tree-optimization/43833] " jiez at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-04-21 14:10 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 761 bytes --]

$ cat t.c
extern unsigned char data[5];

unsigned char
foo (char *str)
{
  int i, j;
  unsigned char c = 0;

  for (i = 0; i < 8; i++)
    {
      j = i * 5;
      if ((j % 8) > 3)
        c |= data[(j / 8) + 1];
    }
  return c;
}

$ gcc t.c -O3 -Wall -c
t.c: In function ‘foo’:
t.c:13:11: warning: array subscript is above array bounds


-- 
           Summary: false warning: array subscript is above array bounds
                    with -O3
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: jiez at gcc dot gnu dot org
        ReportedBy: jiez at gcc dot gnu dot org


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


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

* [Bug tree-optimization/43833] false warning: array subscript is above array bounds with -O3
  2010-04-21 14:10 [Bug middle-end/43833] New: false warning: array subscript is above array bounds with -O3 jiez at gcc dot gnu dot org
@ 2010-04-21 14:49 ` jiez at gcc dot gnu dot org
  2010-04-23  7:23 ` jiez at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-04-21 14:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jiez at gcc dot gnu dot org  2010-04-21 14:48 -------
The patch:

http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01304.html


-- 


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


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

* [Bug tree-optimization/43833] false warning: array subscript is above array bounds with -O3
  2010-04-21 14:10 [Bug middle-end/43833] New: false warning: array subscript is above array bounds with -O3 jiez at gcc dot gnu dot org
  2010-04-21 14:49 ` [Bug tree-optimization/43833] " jiez at gcc dot gnu dot org
@ 2010-04-23  7:23 ` jiez at gcc dot gnu dot org
  2010-04-26 11:00 ` jiez at gcc dot gnu dot org
  2010-04-26 11:00 ` jiez at gcc dot gnu dot org
  3 siblings, 0 replies; 6+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-04-23  7:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jiez at gcc dot gnu dot org  2010-04-23 07:23 -------
Updated patch

http://gcc.gnu.org/ml/gcc-patches/2010-04/msg01386.html


-- 


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


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

* [Bug tree-optimization/43833] false warning: array subscript is above array bounds with -O3
  2010-04-21 14:10 [Bug middle-end/43833] New: false warning: array subscript is above array bounds with -O3 jiez at gcc dot gnu dot org
  2010-04-21 14:49 ` [Bug tree-optimization/43833] " jiez at gcc dot gnu dot org
  2010-04-23  7:23 ` jiez at gcc dot gnu dot org
@ 2010-04-26 11:00 ` jiez at gcc dot gnu dot org
  2010-04-26 11:00 ` jiez at gcc dot gnu dot org
  3 siblings, 0 replies; 6+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-04-26 11:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jiez at gcc dot gnu dot org  2010-04-26 10:59 -------
Subject: Bug 43833

Author: jiez
Date: Mon Apr 26 10:59:34 2010
New Revision: 158727

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158727
Log:
        PR tree-optimization/43833
        * tree-vrp.c (range_int_cst_p): New.
        (range_int_cst_singleton_p): New.
        (extract_range_from_binary_expr): Optimize BIT_AND_EXPR case
        when both operands are constants.  Use range_int_cst_p in
        BIT_IOR_EXPR case.

        testsuite/
        PR tree-optimization/43833
        gcc.dg/Warray-bounds-8.c: New test case.

Added:
    trunk/gcc/testsuite/gcc.dg/Warray-bounds-8.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vrp.c


-- 


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


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

* [Bug tree-optimization/43833] false warning: array subscript is above array bounds with -O3
  2010-04-21 14:10 [Bug middle-end/43833] New: false warning: array subscript is above array bounds with -O3 jiez at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-04-26 11:00 ` jiez at gcc dot gnu dot org
@ 2010-04-26 11:00 ` jiez at gcc dot gnu dot org
  3 siblings, 0 replies; 6+ messages in thread
From: jiez at gcc dot gnu dot org @ 2010-04-26 11:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jiez at gcc dot gnu dot org  2010-04-26 11:00 -------
Subject: Bug 43833

Author: jiez
Date: Mon Apr 26 10:59:48 2010
New Revision: 158728

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158728
Log:
        PR tree-optimization/43833
        * tree-vrp.c (range_int_cst_p): New.
        (range_int_cst_singleton_p): New.
        (extract_range_from_binary_expr): Optimize BIT_AND_EXPR case
        when both operands are constants.  Use range_int_cst_p in
        BIT_IOR_EXPR case.

        testsuite/
        PR tree-optimization/43833
        gcc.dg/Warray-bounds-8.c: New test case.

Added:
    branches/gcc-4_5-branch/gcc/testsuite/gcc.dg/Warray-bounds-8.c
Modified:
    branches/gcc-4_5-branch/gcc/ChangeLog
    branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_5-branch/gcc/tree-vrp.c


-- 


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


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

* [Bug tree-optimization/43833] false warning: array subscript is above array bounds with -O3
       [not found] <bug-43833-4@http.gcc.gnu.org/bugzilla/>
@ 2012-04-18 16:22 ` manu at gcc dot gnu.org
  0 siblings, 0 replies; 6+ messages in thread
From: manu at gcc dot gnu.org @ 2012-04-18 16:22 UTC (permalink / raw)
  To: gcc-bugs

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

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

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

--- Comment #5 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-04-18 16:21:36 UTC ---
Seems fixed. Closing.


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

end of thread, other threads:[~2012-04-18 16:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-21 14:10 [Bug middle-end/43833] New: false warning: array subscript is above array bounds with -O3 jiez at gcc dot gnu dot org
2010-04-21 14:49 ` [Bug tree-optimization/43833] " jiez at gcc dot gnu dot org
2010-04-23  7:23 ` jiez at gcc dot gnu dot org
2010-04-26 11:00 ` jiez at gcc dot gnu dot org
2010-04-26 11:00 ` jiez at gcc dot gnu dot org
     [not found] <bug-43833-4@http.gcc.gnu.org/bugzilla/>
2012-04-18 16:22 ` manu 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).