public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/64277] New: [4.9/5.0 Regression] Incorrect warning "array subscript is above array bounds"
@ 2014-12-11 20:42 aivchenk at gmail dot com
  2014-12-12  9:36 ` [Bug tree-optimization/64277] " rguenth at gcc dot gnu.org
                   ` (22 more replies)
  0 siblings, 23 replies; 24+ messages in thread
From: aivchenk at gmail dot com @ 2014-12-11 20:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 64277
           Summary: [4.9/5.0 Regression] Incorrect warning "array
                    subscript is above array bounds"
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: aivchenk at gmail dot com

>cat test.c
void foo(short a[], short m)                                                    
{                                                                               
  int i, j;                                                                     
  int f1[10];                                                                   
  short nc;                                                                     

  nc = m + 1;                                                                   
  if (nc > 3)                                                                   
    {                                                                           
      for (i = 0; i <= nc; i++)                                                 
        {                                                                       
          f1[i] = f1[i] + 1;                                                    
        }                                                                       
    }                                                                           

  for (i = 0, j = m; i < nc; i++, j--)                                          
    {                                                                           
      a[i] = f1[i];                                                             
      a[j] = i;                                                                 
    }                                                                           
  return;                                                                       
}                          
>gcc -O3 -mssse3 -Wall
/export/users/aivchenk/src/gcc_obj/test.c:21:16: warning: array subscript is
above array bounds [-Warray-bounds]
       a[i] = f1[i]; 
                ^

If compile with "-msse3" there is no warning.


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

end of thread, other threads:[~2015-04-16 12:03 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-11 20:42 [Bug tree-optimization/64277] New: [4.9/5.0 Regression] Incorrect warning "array subscript is above array bounds" aivchenk at gmail dot com
2014-12-12  9:36 ` [Bug tree-optimization/64277] " rguenth at gcc dot gnu.org
2014-12-23 17:35 ` izamyatin at gmail dot com
2014-12-23 20:19 ` manu at gcc dot gnu.org
2014-12-23 20:58 ` aivchenk at gmail dot com
2015-01-12  8:50 ` izamyatin at gmail dot com
2015-01-15  9:05 ` izamyatin at gmail dot com
2015-01-21 15:02 ` [Bug tree-optimization/64277] [4.9/5 " izamyatin at gmail dot com
2015-01-26 12:33 ` enkovich.gnu at gmail dot com
2015-01-26 12:33 ` enkovich.gnu at gmail dot com
2015-01-26 12:43 ` rguenth at gcc dot gnu.org
2015-01-26 13:34 ` rguenth at gcc dot gnu.org
2015-01-26 13:51 ` enkovich.gnu at gmail dot com
2015-01-26 15:08 ` enkovich.gnu at gmail dot com
2015-01-27  9:51 ` rguenth at gcc dot gnu.org
2015-01-27  9:52 ` [Bug tree-optimization/64277] [4.9 " rguenth at gcc dot gnu.org
2015-01-27 10:04 ` rguenth at gcc dot gnu.org
2015-01-27 11:04 ` rguenth at gcc dot gnu.org
2015-01-28 11:42 ` ienkovich at gcc dot gnu.org
2015-01-28 22:15 ` rth at gcc dot gnu.org
2015-02-19 14:14 ` rguenth at gcc dot gnu.org
2015-02-19 14:15 ` rguenth at gcc dot gnu.org
2015-02-24 13:05 ` rguenth at gcc dot gnu.org
2015-04-16 12:03 ` rguenth 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).