public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug regression/16456] New: PowerPC - redundant subtract involving pointer types
@ 2004-07-09 18:05 gcc-bugzilla at gcc dot gnu dot org
  2004-07-09 18:57 ` [Bug other/16456] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-07-09 18:05 UTC (permalink / raw)
  To: gcc-bugs

Description:
A non-optimal code sequence is illustrated.  Two subtract operations are
done where only one is necessary.  Duplicate using gcc 3.5 and command
line:

gcc -O3 -m64 -c test.c

Testcase:
char * ptr1;
char * ptr2;
int x;
long int y;

void foo ()
{
    x = ptr1 - ptr2;
    y = ptr1 - ptr2;
}

Assembly:
      ld 9,.LC0@toc(2)
      ld 11,.LC1@toc(2)
      ld 0,0(9)
      ld 10,0(11)
      ld 8,.LC3@toc(2)
      subf 11,10,0
      ld 9,.LC2@toc(2)
      subf 0,10,0  -- no need to do this subtract, just use the previous
result.
      std 11,0(8)
      stw 0,0(9)
      blr



-- 
           Summary: PowerPC - redundant subtract involving pointer types
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P1
         Component: regression
        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=16456


^ permalink raw reply	[flat|nested] 7+ messages in thread
[parent not found: <bug-16456-8614@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2009-05-14  3:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-09 18:05 [Bug regression/16456] New: PowerPC - redundant subtract involving pointer types gcc-bugzilla at gcc dot gnu dot org
2004-07-09 18:57 ` [Bug other/16456] " pinskia at gcc dot gnu dot org
2004-07-09 19:15 ` [Bug rtl-optimization/16456] " pinskia at gcc dot gnu dot org
2004-11-03 11:20 ` nathan at gcc dot gnu dot org
     [not found] <bug-16456-8614@http.gcc.gnu.org/bugzilla/>
2005-11-02 17:16 ` pinskia at gcc dot gnu dot org
2006-10-22 23:13 ` pinskia at gcc dot gnu dot org
2009-05-14  3:00 ` bje 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).