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



Steven Bosscher <steven at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

           Keywords|                            |ra



--- Comment #14 from Steven Bosscher <steven at gcc dot gnu.org> 2013-02-23 
14:55:53 UTC ---

(In reply to comment #10)



GCC 4.8 r196182, all at -O3 and verified that -Os is similar:



0000000000400470 <optimal_code_generation>:

  400470:       48 8b 45 08             mov    0x8(%rbp),%rax

  400474:       ff e0                   jmpq   *%rax

...



0000000000400480 <unmodified_input_arg_is_copied>:

  400480:       4c 8b 55 08             mov    0x8(%rbp),%r10

  400484:       48 8d 6d 08             lea    0x8(%rbp),%rbp

  400488:       41 ff e2                jmpq   *%r10

...



0000000000400490 <unmodified_input_arg_is_copied_alt>:

  400490:       48 8b 45 08             mov    0x8(%rbp),%rax

  400494:       48 83 c5 08             add    $0x8,%rbp

  400498:       ff e0                   jmpq   *%rax

...



00000000004004a0 <unmodified_input_arg_is_copied_alt2>:

  4004a0:       48 8b 45 08             mov    0x8(%rbp),%rax

  4004a4:       48 83 c5 08             add    $0x8,%rbp

  4004a8:       ff e0                   jmpq   *%rax

...





The reported slowdown in comment #5 is also gone.



For the original complaint, comment #0:



0000000000000000 <push_flag_into_global_reg_var>:

   0:   31 c0                   xor    %eax,%eax

   2:   48 89 da                mov    %rbx,%rdx

   5:   48 39 f7                cmp    %rsi,%rdi

   8:   0f 94 c0                sete   %al

   b:   48 c1 e2 08             shl    $0x8,%rdx

   f:   48 09 d0                or     %rdx,%rax

  12:   48 89 c3                mov    %rax,%rbx

  15:   c3                      retq   

...



0000000000000020 <push_flag_into_local_var>:

  20:   31 c0                   xor    %eax,%eax

  22:   48 39 f7                cmp    %rsi,%rdi

  25:   0f 94 c0                sete   %al

  28:   48 c1 e2 08             shl    $0x8,%rdx

  2c:   48 09 d0                or     %rdx,%rax

  2f:   c3                      retq   



So the code for push_flag_into_local_var is the same as gcc-3.3 and the

code for push_flag_into_global_reg_var is the same as gcc-4.4.

Reply via email to