building this testcase with -O2 -march=athlon -Wall -fprefetch-loop-arrays
gives:

warning: array subscript is above array bounds
[...]

which, according to VRP, seems to be valid. 

testcase is:

=== Cut ===
struct real_value
{
  unsigned int cl:2;
  unsigned int decimal:1;
  unsigned long sig[5];
};
unsigned int uexp;

static void
clear_significand_below (struct real_value *r, unsigned int n)
{
  int i, w = n / 32;
  for (i = 0; i < w; ++i)
    r->sig[i] = 0;
}
void
do_fix_trunc (struct real_value *r)
{
  if (uexp < 160)
    clear_significand_below (r, 160 - uexp);
}
=== Cut ===


-- 
           Summary: array overflow warning due to incorrect loop unrolling
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mueller at gcc dot gnu dot org


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

Reply via email to