Hi, 

-O2 Warray-bounds:

=== Cut ===
struct PhaseEntryType
{
  char raw_field[50 + 1];
};
int
ParsePhase (char in_cols[15][250], struct PhaseEntryType *P)
{
  __builtin_strncpy (P->raw_field, in_cols[2], 50);
}
~
=== Cut ===

triggered by 

  __builtin_strncpy ((char *) &P->raw_field, (const char *) (char *) in_cols +
500B, 50);

being gimplified to:
  D.1970 = &(*in_cols)[500];
  D.1971 = &P->raw_field[0];
  __builtin_strncpy (D.1971, D.1970, 50)


-- 
           Summary: bogus array-ref fold triggering array overflow warning
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mueller at gcc dot gnu dot org
  GCC host triplet: i686-suse-linux


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

Reply via email to