This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/16801] New: PowerPC - forward store motion opportunity
- From: "gcc-bugzilla at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Jul 2004 17:00:58 -0000
- Subject: [Bug other/16801] New: PowerPC - forward store motion opportunity
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Description:
A non-optimal code sequence is illustrated. There exists an opportunity to perform forward store motion. Duplicate using gcc 3.5 and command line:
gcc -O3 -m64 -c test.c
Testcase:
typedef struct {
unsigned int e;
} str;
char *q;
void foo (char *p) {
while (1) {
q = p - ((str *)p)->e;
if (((str *)q)->e) break;
p = q;
}
}
Assembly:
.foo:
lwz 0,0(3)
ld 11,.LC0@toc(2)
subf 3,0,3
std 3,0(11)
lwz 0,0(3)
cmpwi 7,0,0
bnelr- 7
mr 9,3
.L4:
lwz 0,0(9)
subf 9,0,9
std 9,0(11) <-- candidate for forward store motion out of the loop.
lwz 0,0(9)
cmpwi 7,0,0
beq+ 7,.L4
blr
--
Summary: PowerPC - forward store motion opportunity
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P1
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: steinmtz at us dot ibm dot com
CC: gcc-bugs at gcc dot gnu dot org,steinmtz at us dot ibm
dot com
GCC build triplet: powerpc64-linux
GCC host triplet: powerpc64-linux
GCC target triplet: powerpc64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16801