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: using emit_library_call


I've tried using emit_library_call during rtl generation, like this:

    emit_library_call (fn_rtx, 0,
		       VOIDmode, 2,
		       operand1_rtx, SImode,
		       operand2_rtx, SImode
		       );

but it still doesn't work most of the time (more often *with*
optimization than without). Do I have to use start_sequence etc? What if I
do this during the preparation of a call to another function when some of
the arguments for that function is already in place?

Is it at all possible to emit calls at arbitrary points in the insn chain,
or can it only be done at certain places (how can I tell?)?

/Per =O)


On Mon, 5 Aug 2002, Richard Henderson wrote:

> On Mon, Aug 05, 2002 at 08:45:18PM +0200, Per Fransson wrote:
> > Can emit_library_call be used at any point during RTL generation with any
> > rtx's as as arguments (to be used as arguments to the library function I
> > wish to call)?
>
> No.  Basically only during initial rtl generation.  You can
> sometime get away with emitting calls later on targets that
> pass parameters in registers, but that's sort of accidental.
> For targets that pass parameters on the stack, all calls must
> be emitted before virtual register instantiation.
>
> > Also, the comment to emit_library_call mentions a function called
> > 'protect_from_queue'; what does it mean that  an expression is queued?
>
>   foo(i++)
>
> The post-incrememt will be queued.
>
>
> r~
>


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