http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49444
Summary: IV-OPTs changes an unaligned loads into aligned loads incorrectly Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization AssignedTo: unassig...@gcc.gnu.org ReportedBy: pins...@gcc.gnu.org Take: /* { dg-do compile { target mips*-*-* } } */ /* { dg-options "-O2" } */ /* { dg-final { scan-assembler "uld\\t|ldr\\t|lwr\\t" } } */ struct s { unsigned int l; unsigned int z[2]; }; struct r { char c; struct s s; } __attribute__ ((packed)); struct s *ss; f (struct r *p, int l) { int i; for (i = 0; i < l; i++) { *ss = p[i].s; g (); } } --- CUT --- Currently this fails and the load from p[i].s is turned into an aligned load.