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

            Bug ID: 69258
           Summary: Flexible arrays break TBAA
           Product: gcc
           Version: 5.3.0
            Status: UNCONFIRMED
          Keywords: alias, wrong-code
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
  Target Milestone: ---

struct Xflex { int n; int a[1]; };
struct Xspecific { int n; int a[7]; } x;

int foo (struct Xflex *f)
{
  f->a[6] = 2;
  x.a[6] = 1;
  return f->a[6];
}

returns 2 with -fstrict-aliasing :(

Reply via email to