This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/41033] New: RTL alias-oracle does not honor -fno-strict-aliasing


struct X {
  int i;
  int j;
};

int foo(struct X *p, struct X *q)
{
  p->j = 1;
  q->i = 0;
  return p->j;
}

extern void abort (void);

int main()
{
  struct X x;
  if (foo (&x, (struct X *)&x.j) != 0)
    abort ();
  return 0;
}

is miscompiled at -O1.


-- 
           Summary: RTL alias-oracle does not honor -fno-strict-aliasing
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]