This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bug? flow_find_cross_jump deletes USE insns ...



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.

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.
In case of an indirect call I don't add it.  This seems to work fine
as far as I can see.  Why do you think it shouldn't work?

If I were to use an explicit USE, I'd have to duplicate all the call
insns to have one form with USE and one without; I don't see what this
would help.


Mit freundlichen Gruessen / Best Regards

Ulrich Weigand

--
  Dr. Ulrich Weigand
  Linux for S/390 Design & Development
  IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
  Phone: +49-7031/16-3727   ---   Email: Ulrich.Weigand@de.ibm.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]