public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39942]  New: Nonoptimal code - leaveq; xchg   %ax,%ax; retq
@ 2009-04-28 12:20 vvv at ru dot ru
  2009-04-28 13:42 ` [Bug target/39942] " pinskia at gcc dot gnu dot org
                   ` (51 more replies)
  0 siblings, 52 replies; 54+ messages in thread
From: vvv at ru dot ru @ 2009-04-28 12:20 UTC (permalink / raw)
  To: gcc-bugs

Sometimes we can see 2 bytes nop (xchg %ax,%ax) between leaveq and retq.
IMHO, better to remove xchg %ax,%ax

Examples from Kernel 2.6.29.1:

> gcc --version
gcc (SUSE Linux) 4.3.2 [gcc-4_3-branch revision 141291]
> objdump vmlinux
...
ffffffff804262e0 <set_blitting_type>:
ffffffff804262e0:       55                      push   %rbp
ffffffff804262e1:       0f b7 07                movzwl (%rdi),%eax
ffffffff804262e4:       4c 8b 86 d0 03 00 00    mov    0x3d0(%rsi),%r8
ffffffff804262eb:       48 c1 e0 07             shl    $0x7,%rax
ffffffff804262ef:       48 89 e5                mov    %rsp,%rbp
ffffffff804262f2:       48 05 40 1f 9c 80       add    $0xffffffff809c1f40,%rax
ffffffff804262f8:       49 89 80 90 01 00 00    mov    %rax,0x190(%r8)
ffffffff804262ff:       8b 46 04                mov    0x4(%rsi),%eax
ffffffff80426302:       89 c1                   mov    %eax,%ecx
ffffffff80426304:       81 e1 00 00 02 00       and    $0x20000,%ecx
ffffffff8042630a:       75 2c                   jne    ffffffff80426338
<set_blitting_type+0x58>
ffffffff8042630c:       48 8b 86 d0 03 00 00    mov    0x3d0(%rsi),%rax
ffffffff80426313:       4c 89 c7                mov    %r8,%rdi
ffffffff80426316:       48 8b 90 90 01 00 00    mov    0x190(%rax),%rdx
ffffffff8042631d:       8b 52 1c                mov    0x1c(%rdx),%edx
ffffffff80426320:       83 fa 03                cmp    $0x3,%edx
ffffffff80426323:       0f 4e ca                cmovle %edx,%ecx
ffffffff80426326:       89 88 b0 01 00 00       mov    %ecx,0x1b0(%rax)
ffffffff8042632c:       e8 2f 4d 00 00          callq  ffffffff8042b060
<fbcon_set_bitops>
ffffffff80426331:       c9                      leaveq 
ffffffff80426332:       c3                      retq   
ffffffff80426333:       0f 1f 44 00 00          nopl   0x0(%rax,%rax,1)
ffffffff80426338:       e8 23 61 00 00          callq  ffffffff8042c460
<fbcon_set_tileops>
ffffffff8042633d:       c9                      leaveq 
ffffffff8042633e:       66 90                   xchg   %ax,%ax
ffffffff80426340:       c3                      retq   

...
...

ffffffff8042b060 <fbcon_set_bitops>:
ffffffff8042b060:       55                      push   %rbp
ffffffff8042b061:       48 c7 07 d0 ad 42 80    movq  
$0xffffffff8042add0,(%rdi)
ffffffff8042b068:       8b 87 b0 01 00 00       mov    0x1b0(%rdi),%eax
ffffffff8042b06e:       48 89 e5                mov    %rsp,%rbp
ffffffff8042b071:       48 c7 47 08 30 ae 42    movq  
$0xffffffff8042ae30,0x8(%rdi)
ffffffff8042b078:       80 
ffffffff8042b079:       48 c7 47 10 c0 b7 42    movq  
$0xffffffff8042b7c0,0x10(%rdi)
ffffffff8042b080:       80 
ffffffff8042b081:       48 c7 47 18 10 af 42    movq  
$0xffffffff8042af10,0x18(%rdi)
ffffffff8042b088:       80 
ffffffff8042b089:       48 c7 47 20 10 b1 42    movq  
$0xffffffff8042b110,0x20(%rdi)
ffffffff8042b090:       80 
ffffffff8042b091:       48 c7 47 28 c0 b0 42    movq  
$0xffffffff8042b0c0,0x28(%rdi)
ffffffff8042b098:       80 
ffffffff8042b099:       48 c7 47 30 00 00 00    movq   $0x0,0x30(%rdi)
ffffffff8042b0a0:       00 
ffffffff8042b0a1:       85 c0                   test   %eax,%eax
ffffffff8042b0a3:       75 0b                   jne    ffffffff8042b0b0
<fbcon_set_bitops+0x50>
ffffffff8042b0a5:       c9                      leaveq 
ffffffff8042b0a6:       c3                      retq   
ffffffff8042b0a7:       66 0f 1f 84 00 00 00    nopw   0x0(%rax,%rax,1)
ffffffff8042b0ae:       00 00 
ffffffff8042b0b0:       e8 4b 15 00 00          callq  ffffffff8042c600
<fbcon_set_rotate>
ffffffff8042b0b5:       c9                      leaveq 
ffffffff8042b0b6:       66 90                   xchg   %ax,%ax
ffffffff8042b0b8:       c3                      retq


-- 
           Summary: Nonoptimal code - leaveq; xchg   %ax,%ax; retq
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: vvv at ru dot ru


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


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

end of thread, other threads:[~2020-04-14 21:20 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-28 12:20 [Bug c/39942] New: Nonoptimal code - leaveq; xchg %ax,%ax; retq vvv at ru dot ru
2009-04-28 13:42 ` [Bug target/39942] " pinskia at gcc dot gnu dot org
2009-04-28 17:05 ` vvv at ru dot ru
2009-04-28 17:10 ` vvv at ru dot ru
2009-04-28 17:15 ` vvv at ru dot ru
2009-04-28 17:37 ` ubizjak at gmail dot com
2009-04-28 21:19 ` vvv at ru dot ru
2009-04-28 21:23 ` pinskia at gcc dot gnu dot org
2009-04-28 21:47 ` ubizjak at gmail dot com
2009-04-28 21:53 ` pinskia at gcc dot gnu dot org
2009-04-28 21:54 ` ubizjak at gmail dot com
2009-04-29  7:46 ` vvv at ru dot ru
2009-04-29  7:55 ` vvv at ru dot ru
2009-04-29  9:32 ` jakub at gcc dot gnu dot org
2009-04-29 10:13 ` jakub at gcc dot gnu dot org
2009-04-29 19:17 ` vvv at ru dot ru
2009-04-30  9:07 ` jakub at gcc dot gnu dot org
2009-05-12 16:41 ` vvv at ru dot ru
2009-05-13  8:31 ` jakub at gcc dot gnu dot org
2009-05-13 11:43 ` vvv at ru dot ru
2009-05-13 13:32 ` rguenth at gcc dot gnu dot org
2009-05-13 17:13 ` vvv at ru dot ru
2009-05-13 18:22 ` ubizjak at gmail dot com
2009-05-13 18:34 ` rguenth at gcc dot gnu dot org
2009-05-13 18:45 ` hjl dot tools at gmail dot com
2009-05-13 18:57 ` vvv at ru dot ru
2009-05-13 19:06 ` vvv at ru dot ru
2009-05-13 19:09 ` jakub at gcc dot gnu dot org
2009-05-13 19:19 ` vvv at ru dot ru
2009-05-13 21:44 ` hjl dot tools at gmail dot com
2009-05-14  9:01 ` vvv at ru dot ru
2009-05-14 15:16 ` jakub at gcc dot gnu dot org
2009-05-14 15:58 ` hjl dot tools at gmail dot com
2009-05-14 18:37 ` hjl dot tools at gmail dot com
2009-05-14 19:44 ` vvv at ru dot ru
2009-05-15  2:23 ` hjl dot tools at gmail dot com
2009-05-15  4:32 ` hjl dot tools at gmail dot com
2009-05-15  7:56 ` jakub at gcc dot gnu dot org
2009-05-15 12:11 ` jakub at gcc dot gnu dot org
2009-05-15 12:12 ` jakub at gcc dot gnu dot org
2009-05-15 14:35 ` hjl dot tools at gmail dot com
2009-05-15 16:25 ` jakub at gcc dot gnu dot org
2009-05-15 18:18 ` jakub at gcc dot gnu dot org
2009-05-15 18:23 ` jakub at gcc dot gnu dot org
2009-05-15 23:06 ` hjl dot tools at gmail dot com
2009-05-16  6:38 ` jakub at gcc dot gnu dot org
2009-05-16  7:10 ` jakub at gcc dot gnu dot org
2009-05-16  7:12 ` jakub at gcc dot gnu dot org
2009-05-18 17:21 ` hjl at gcc dot gnu dot org
2009-05-20 21:38 ` vvv at ru dot ru
2009-05-20 22:09 ` jakub at gcc dot gnu dot org
2009-05-21 13:22 ` jakub at gcc dot gnu dot org
2009-05-21 13:26 ` jakub at gcc dot gnu dot org
     [not found] <bug-39942-4@http.gcc.gnu.org/bugzilla/>
2020-04-14 21:20 ` peter at cordes dot ca

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