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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-07-08 
14:06:53 UTC ---
The reason for that is that, when not emitting typed DWARF, we have the call
site value of %edi:

(if_then_else:SI (ne (entry_value:SI (reg:SI 5 di [ i ]))
                (const_int 200 [0xc8]))
            (plus:SI (entry_value:SI (reg:SI 5 di [ i ]))
                (const_int 2 [0x2]))
            (const_int 203 [0xcb]))

and x86-64 has 64-bit DWARF2_ADDR_SIZE and we want to compare just the low 32
bits of the register.  DW_OP_ne compares whole 64-bit (untyped) integers, so
by shifting it up by 32 bits it can be compared easily.  In this exact case
when
it can be done as unsigned comparison too we could very well do:
@@ -134,11 +134,11 @@ self:
        .byte   0xf3    # DW_OP_GNU_entry_value
        .uleb128 0x1
        .byte   0x55    # DW_OP_reg5
-       .byte   0x8     # DW_OP_const1u
-       .byte   0x20
-       .byte   0x24    # DW_OP_shl
-       .byte   0x10    # DW_OP_constu
-       .uleb128 0xc800000000
+       .byte   0xc     # DW_OP_const4u
+       .long   0xffffffff
+       .byte   0x1a    # DW_OP_and
+       .byte   0x10    # DW_OP_const1u
+       .byte   0xc8
        .byte   0x2e    # DW_OP_ne
        .byte   0x28    # DW_OP_bra
        .value  0x1

and save 2 bytes instead.  But if it would be >/>=/</<= signed comparison
instead, I think comparing in most significant bits is still shorter.

BTW, self isn't inlined, it is tail recursion optimized.

Reply via email to