This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/38480] bogus warning with -O3 -Wall: "array subscript is above array bounds"



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-12-16 20:40 -------
we have:
unsigned short foobar;
int i = (int)foobar;
if (i > 99)
  if (foobar <= 99)
    access array[i];

so i can never be negative and foobar will never be greater than 99.
This is both a missed optimization dealing with VRP and a diagnostic issue.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
          Component|c                           |tree-optimization
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic, missed-
                   |                            |optimization
   Last reconfirmed|0000-00-00 00:00:00         |2008-12-16 20:40:17
               date|                            |


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]