public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug optimization/11708] New: Non-Optimal jump code generation.
@ 2003-07-29 13:42 naveens at noida dot hcltech dot com
  2003-07-29 13:46 ` [Bug optimization/11708] " naveens at noida dot hcltech dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: naveens at noida dot hcltech dot com @ 2003-07-29 13:42 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11708

           Summary: Non-Optimal jump code generation.
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: naveens at noida dot hcltech dot com
                CC: gcc-bugs at gcc dot gnu dot org,joern dot rennecke at
                    superh dot com
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: sh-unknown-elf

I am seeing some redundant jumps in code generated by GCC3.3 and 
the mainline. e.g. I see this assembly generated for 
one of my benchmark (sh-elf target, options: -ml -m4 -O2)

        ! basic block 1
        cmp/pl  r3
        mov.w   .L147,r1
        bt      .L3     <--- conditional branch C1
        mov     #0,r1
        bra     .L208   <--- Branch B1
        mov     r1,r3   <--- delay slot
.L3:
        ! basic block 2
        mov     r1,r3
.L208:
        mov.w   .L149,r2
        mov.w   .L150,r1
        cmp/gt  r1,r3
        bt      .L7

It seems it should be better generated as:

        ! basic block 1
        cmp/pl  r3
        mov.w   .L147,r1
        bt      .L208    <--- conditional branch C1
        mov     #0,r1
.L208:
       ! basic block 2
        mov     r1,r3
        mov.w   .L149,r2
        mov.w   .L150,r1
        cmp/gt  r1,r3
        bt      .L7

So, a jump(bra) instruction could be eliminated.


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

end of thread, other threads:[~2004-01-05  6:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-29 13:42 [Bug optimization/11708] New: Non-Optimal jump code generation naveens at noida dot hcltech dot com
2003-07-29 13:46 ` [Bug optimization/11708] " naveens at noida dot hcltech dot com
2003-07-29 13:48 ` pinskia at physics dot uc dot edu
2003-07-29 14:10 ` naveens at noida dot hcltech dot com
2003-07-29 14:20 ` [Bug optimization/11708] [sh4-elf-gcc] " naveens at noida dot hcltech dot com
2003-08-11 12:42 ` pinskia at gcc dot gnu dot org
2003-08-11 17:48 ` pinskia at gcc dot gnu dot org
2003-08-25  0:04 ` dhazeghi at yahoo dot com
2003-09-17  7:20 ` naveens at noida dot hcltech dot com
2004-01-03 19:46 ` pinskia at gcc dot gnu dot org
2004-01-05  6:01 ` naveens at noida dot hcltech dot com

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