Hello all,

The gcc port that i am currently working on has both long calls and
short calls. If no 'shortcall' attribute is provided in the function
declaration then calls to that function is made as long call. This is
happening when no optimization is enabled. But when optimization is
enabled combine pass is merging the instructions to replace the long
call with short call.

from bar.c.26.life1 :
>>>>>>
(note 14 11 16 0 [bb 0] NOTE_INSN_BASIC_BLOCK)

(insn 16 14 17 0 (set (reg/f:HI 27)
        (symbol_ref:HI ("fun3") [flags 0x41] <function_decl 0xb7d4e980
fun3>)) 9 {movhi_const} (nil)
    (nil))

(call_insn 17 16 22 0 (set (reg:HI 0 R0)
        (call:HI (mem:HI (reg/f:HI 27) [0 S2 A16])
            (const_int 0 [0x0]))) 25 {*call_value_internal}
(insn_list:REG_DEP_TRUE 16 (nil))
    (expr_list:REG_DEAD (reg/f:HI 27)
        (nil))
    (nil))
>>>>>>


from  bar.c.27.combine
>>>>>>
(note 14 11 16 0 [bb 0] NOTE_INSN_BASIC_BLOCK)

(note 16 14 17 0 NOTE_INSN_DELETED)

(call_insn 17 16 22 0 (set (reg:HI 0 R0)
        (call:HI (mem:HI (symbol_ref:HI ("fun3") [flags 0x41]
<function_decl 0xb7d4e980 fun3>) [0 S2 A16])
            (const_int 0 [0x0]))) 25 {*call_value_internal} (nil)
    (nil)
    (nil))
>>>>>>

What could be the problem?

Thanks for your time.

Regards,
Shafi

Reply via email to