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

            Bug ID: 126331
           Summary: wrong __builtin_object_size with interior FAM
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: amonakov at gcc dot gnu.org
  Target Milestone: ---

This returns 12, but the "closest surrounding subobject" is not that large:

struct {
    struct {
        long long l;
        int i;
        int fam[];
    } sub;
    long long j;
} s;

int f()
{
    return __builtin_object_size(&s.sub.fam, 1);
}

Reply via email to