This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/71309] New: Copying fields within a struct followed by use results in load hit store
- From: "anton at samba dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 27 May 2016 12:07:39 +0000
- Subject: [Bug tree-optimization/71309] New: Copying fields within a struct followed by use results in load hit store
- Auto-submitted: auto-generated
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