struct {
        int i;
        int j;
        int x[2];
} a;

int foo(void)
{
        a.i = 1;
        a.j = 0;
        a.x[0] = 5;
        return a.i + a.j;
}

does not get optimized, because salias disables subvars for a
because it contains an array.  I have a simple patch in testing.

-- 
           Summary: array in struct disables salias subvars for other fields
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, alias
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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

Reply via email to