gcc-4.4 gave spurious "warning: array subscript is above array bounds"

Bug #732711 reported by Edmund Grimley Evans
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-4.4 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: gcc-4.4

// This code gives a spurious
// "warning: array subscript is above array bounds"
// with gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5)
// when compiled with: gcc -c -O2 -Wall

struct s { int a[100]; };

void f(struct s *ps, int i)
{
  int *a = ps->a;
  if (i >= 0x20000000 && i < 0x20000004)
    a[i - 0x20000000] = 0;
}

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: gcc-4.4 4.4.4-14ubuntu5
ProcVersionSignature: Ubuntu 2.6.35-980.1release9-omap4 2.6.35.3
Uname: Linux 2.6.35-980-omap4 armv7l
Architecture: armel
Date: Thu Mar 10 16:51:56 2011
ProcEnviron:
 LC_COLLATE=C
 LANG=en_GB.UTF-8
 SHELL=/bin/bash
SourcePackage: gcc-4.4

Revision history for this message
Edmund Grimley Evans (edmund-grimley-evans) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.