Due to wrong TBAA pruning of points-to sets we miscompile the following once
we inline foo into main.

union U { float f; int i; };

/* GCC says the access through the union does alias the bare variable.  */
int foo(union U *u, int *i)
{
  *i = 1;
  u->f = 0.0;
  return *i;
}

extern void abort (void);
int main()
{
  int i;
  if (foo ((union U *)&i, &i) != 0)
    abort ();
  return 0;
}


-- 
           Summary: [4.4 Regression] Access through union does not conflict
                    properly
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: tree-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=38806

Reply via email to