Bug? flow_find_cross_jump deletes USE insns ...

Jan Hubicka jh@suse.cz
Wed Jan 16 08:48:00 GMT 2002


> 
> Jan Hubicka wrote:
> 
> >As I tried previously, CALL_INSN_FUCNTION_USGE way is tricky.
> >At least on i386, you don't need GOT when function is called indirectly,
> >so I don't add it to the FUSAGE, but when the indirect call is changed
> >to direct, I get wrong insn, as I can't check validity of FUSAGE in
> >the pattern.
> >It is better to use separate USE IMO.
> 
> I'm not sure I understand the problem, maybe it's i386 specific ...
> Could you elaborate?  Was does 'indirect call is changed to direct' mean?
> 
> On s390, we use the same insn for indirect and direct calls (a 'direct
> call' is basically:  load target from literal pool into register, then
> do an indirect call via that register).  If that target is a PLT stub,
> then we need to have the GOT register set, if not then not.

I see, then you need PLT for each libcall.  On the i386 if the call is direct
(function symbolic address is known at compilation time), it goes to PLT and
needs GOT, unless it is static function where IP relative addressing is used.
In case it is indirect, it do use address of final function, so it does not
need GOT.
> 
> What I've done now is to add the GOT register to the
> CALL_INSN_FUNCTION_USAGE when constructing the 'load PLT address from
> literal pool into register; call via register' sequence in gen_call.

That should work in your case.

Honza



More information about the Gcc mailing list