https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71309
Bug ID: 71309 Summary: Copying fields within a struct followed by use results in load hit store Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: anton at samba dot org Target Milestone: --- When chasing down a LHS on ppc64le, I found the following issue: struct path { void *mnt; void *dentry; }; struct nameidata { struct path path; struct path root; }; void *foo(struct nameidata *nd) { void *d; nd->path = nd->root; d = nd->path.dentry; return d; } On little endian we get: ld 11,24(3) ld 10,16(3) std 11,8(3) std 10,0(3) ori 2,2,0 ld 3,8(3) blr Strangely big endian is fine: ld 3,24(3) ld 10,16(9) std 3,8(9) std 10,0(9) blr