public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/16801] New: PowerPC - forward store motion opportunity
@ 2004-07-28 17:00 gcc-bugzilla at gcc dot gnu dot org
  2004-07-28 17:36 ` [Bug target/16801] " bangerth at dealii dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-07-28 17:00 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-11-11 17:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-28 17:00 [Bug other/16801] New: PowerPC - forward store motion opportunity gcc-bugzilla at gcc dot gnu dot org
2004-07-28 17:36 ` [Bug target/16801] " bangerth at dealii dot org
2004-07-28 18:42 ` falk at debian dot org
2004-07-29  4:53 ` [Bug tree-optimization/16801] " pinskia at gcc dot gnu dot org
2004-09-24 13:14 ` pinskia at gcc dot gnu dot org
2004-11-11 17:27 ` nathan at gcc dot gnu dot org
2004-11-11 17:31 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).