On 12/05/09 01:01, daniel tian wrote:
Yeah. The Move Symbol to R0 register is deleted, which is weird.
And I still can not figure out why. Which means I still need to dig it.
But I found when I used the gcc-4.0.2 version, the Call insn call the
function direction
call the function symbol which is OK.
I mean how gcc determine to call the function directly with the function symbol
or move the function symbol ref into a register then call the register.
Obviously, now the gcc-4.3.0 in my porting is working in the latter one.
I found that gcc will choose to call symbol or register according a
TARGET MACRO --
NO_FUNCTION_CSE. Here is the comment in internal document:
Define this macro if it is as good or better to call a constant
function address than to call an address kept in a register.
Right. When the cost of an indirect call is the same or greater than
the cost of a direct call, then you should define NO_FUNCTION_CSE.
Otherwise you would not define it.
Now I defined the macro, the bug disappears. But I still need to know
why gcc delete my insn.
Right. You've just papered over the problem. You need to debug reload
and see whether or not the insn is ever emitted into the insn stream and
if so when it gets deleted.
You might start by monitoring emit_reload_insns's behavior when it
handles your insn.
jeff