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/55085] New: [4.8 regression] false positive -Warray-bounds


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

             Bug #: 55085
           Summary: [4.8 regression] false positive -Warray-bounds
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dimhen@gmail.com


$ gcc -Werror -Wall -Wextra -O2 -funroll-loops -c 1.c
1.c: In function 'bar':
1.c:12:11: error: array subscript is above array bounds [-Werror=array-bounds]
      if(!a[i])
           ^
void bar(unsigned m)
{
    void *a[3];

    int i;
    for(i=0; i<(int)m; i++)
        a[i]=0; // missing warning ?

    switch(m) {
    case 2:
    for(i=0; i<(int)m; i++)
        if(!a[i])
        return;
    }
}


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