This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug? flow_find_cross_jump deletes USE insns ...
- From: "Ulrich Weigand" <Ulrich dot Weigand at de dot ibm dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Richard Henderson <rth at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Tue, 15 Jan 2002 20:42:26 +0100
- Subject: 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