public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: optimization/6990: -O do better optimization than -O3/-O2/-Os on jump-to-jump for PowerPC
@ 2002-07-10 13:31 dje
  0 siblings, 0 replies; 3+ messages in thread
From: dje @ 2002-07-10 13:31 UTC (permalink / raw)
  To: fshvaige, gcc-bugs, gcc-prs, nobody

Synopsis: -O do better optimization than -O3/-O2/-Os on jump-to-jump for PowerPC

State-Changed-From-To: open->analyzed
State-Changed-By: dje
State-Changed-When: Wed Jul 10 13:31:54 2002
State-Changed-Why:
    cleanup_cfg merging exit blocks

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6990


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

* optimization/6990: -O do better optimization than -O3/-O2/-Os on jump-to-jump for PowerPC
@ 2002-06-13  8:46 fshvaige
  0 siblings, 0 replies; 3+ messages in thread
From: fshvaige @ 2002-06-13  8:46 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/6990; it has been noted by GNATS.

From: fshvaige@cisco.com
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: optimization/6990: -O do better optimization than -O3/-O2/-Os on jump-to-jump for PowerPC
Date: 11 Jun 2002 11:58:49 -0000

 >Number:         6990
 >Category:       optimization
 >Synopsis:       -O do better optimization than -O3/-O2/-Os on jump-to-jump for PowerPC
 >Confidential:   no
 >Severity:       non-critical
 >Priority:       medium
 >Responsible:    unassigned
 >State:          open
 >Class:          pessimizes-code
 >Submitter-Id:   net
 >Arrival-Date:   Tue Jun 11 05:06:01 PDT 2002
 >Closed-Date:
 >Last-Modified:
 >Originator:     fshvaige@cisco.com
 >Release:        3.1 20020510
 >Organization:
 >Environment:
 --with-gcc-version-trigger=/home/install/gcc-3.1-20020510/gcc/version.c --host=i686-pc-linux-gnu --with-newlib --enable-target-optspace --target=ppc-eabi --prefix=/home/crossGCC/ppc-eabi --with-local-prefix=/home/crossGCC/ppc-eabi --program-prefix=ppc-eabi- --enable-languages=c,c++ -v --norecursion
 >Description:
 File memmove.c with function memmove():
 
 void *memmove (void *dst, const void *src, unsigned n) {
   void * tmp = dst;
   char * d = (char*)dst;
   char * s = (char*)src;
   if (n) { 
     if (d > s) {
       d += n;           
       s += n;           
       l1: //do-while loop bug in gcc 3.1 #6984
         * --d = * --s;          
       if (--n) goto l1; 
     } else {    
       --d;              
       --s;              
       l2: //do-while loop bug in gcc 3.1 #6984
         * ++d = * ++s;          
       if (--n) goto l2; 
     }           
   }     
   return tmp;
 }
 
 Compilation with -O produces code:
 
 memmove:
   mtctr 5
   cmpwi 0,5,0 
   beqlr- 0
   cmplw 0,3,4 
   ble- 0,.L3 
   add 9,3,5 
   add 4,4,5 
 .L4:
   lbzu 0,-1(4)
   stbu 0,-1(9)
   bdnz .L4
   blr   
 .L3:
   addi 9,3,-1
   addi 4,4,-1
 .L7:
   lbzu 0,1(4)
   stbu 0,1(9)
   bdnz .L7
   blr
 
 Compilation with -O3 produces code:
 
 memmove:
   cmpwi 0,5,0 
   mtctr 5
   beqlr- 0
   cmplw 0,3,4 
   ble- 0,.L3 
   add 9,3,5 
   add 4,4,5 
 .L4:
   lbzu 5,-1(4)
   stbu 5,-1(9)
   bdnz .L4
 .L2:
   blr   
 .L3:
   addi 9,3,-1
   addi 4,4,-1
 .L7:
   lbzu 5,1(4)
   stbu 5,1(9)
   bdnz .L7
   b .L2 
 
 Note last instruction 'b .L2' - it is jump to another jump 'blr' after label '.L2'.
 -O managed to produce 'blr' for last instruction.
 >How-To-Repeat:
 Command lines looks like:
 ppc-eabi-gcc -S -O memmove.c -Wall
 ppc-eabi-gcc -S -O3 memmove.c -Wall
 >Fix:
 
 >Release-Note:
 >Audit-Trail:
 >Unformatted:


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

* optimization/6990: -O do better optimization than -O3/-O2/-Os on jump-to-jump for PowerPC
@ 2002-06-11  5:06 fshvaige
  0 siblings, 0 replies; 3+ messages in thread
From: fshvaige @ 2002-06-11  5:06 UTC (permalink / raw)
  To: gcc-gnats


>Number:         6990
>Category:       optimization
>Synopsis:       -O do better optimization than -O3/-O2/-Os on jump-to-jump for PowerPC
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 11 05:06:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     fshvaige@cisco.com
>Release:        3.1 20020510
>Organization:
>Environment:
--with-gcc-version-trigger=/home/install/gcc-3.1-20020510/gcc/version.c --host=i686-pc-linux-gnu --with-newlib --enable-target-optspace --target=ppc-eabi --prefix=/home/crossGCC/ppc-eabi --with-local-prefix=/home/crossGCC/ppc-eabi --program-prefix=ppc-eabi- --enable-languages=c,c++ -v --norecursion
>Description:
File memmove.c with function memmove():

void *memmove (void *dst, const void *src, unsigned n) {
  void * tmp = dst;
  char * d = (char*)dst;
  char * s = (char*)src;
  if (n) { 
    if (d > s) {
      d += n;           
      s += n;           
      l1: //do-while loop bug in gcc 3.1 #6984
        * --d = * --s;          
      if (--n) goto l1; 
    } else {    
      --d;              
      --s;              
      l2: //do-while loop bug in gcc 3.1 #6984
        * ++d = * ++s;          
      if (--n) goto l2; 
    }           
  }     
  return tmp;
}

Compilation with -O produces code:

memmove:
  mtctr 5
  cmpwi 0,5,0 
  beqlr- 0
  cmplw 0,3,4 
  ble- 0,.L3 
  add 9,3,5 
  add 4,4,5 
.L4:
  lbzu 0,-1(4)
  stbu 0,-1(9)
  bdnz .L4
  blr   
.L3:
  addi 9,3,-1
  addi 4,4,-1
.L7:
  lbzu 0,1(4)
  stbu 0,1(9)
  bdnz .L7
  blr

Compilation with -O3 produces code:

memmove:
  cmpwi 0,5,0 
  mtctr 5
  beqlr- 0
  cmplw 0,3,4 
  ble- 0,.L3 
  add 9,3,5 
  add 4,4,5 
.L4:
  lbzu 5,-1(4)
  stbu 5,-1(9)
  bdnz .L4
.L2:
  blr   
.L3:
  addi 9,3,-1
  addi 4,4,-1
.L7:
  lbzu 5,1(4)
  stbu 5,1(9)
  bdnz .L7
  b .L2 

Note last instruction 'b .L2' - it is jump to another jump 'blr' after label '.L2'.
-O managed to produce 'blr' for last instruction.
>How-To-Repeat:
Command lines looks like:
ppc-eabi-gcc -S -O memmove.c -Wall
ppc-eabi-gcc -S -O3 memmove.c -Wall
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-07-10 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-10 13:31 optimization/6990: -O do better optimization than -O3/-O2/-Os on jump-to-jump for PowerPC dje
  -- strict thread matches above, loose matches on Subject: below --
2002-06-13  8:46 fshvaige
2002-06-11  5:06 fshvaige

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).