On Wed, 2022-01-19 at 10:45 +0000, Richard Sandiford wrote:
> Andras Tantos <and...@tantosonline.com> writes:
> > All,
> > 
> > I'm working on porting GCC to a processor architecture that doesn't
> > have 
> > a (HW) stack nor a call instruction. This means that for calls, I
> > need 
> > to generate the following instruction sequence:
> > 
> >      // move stack-pointer:
> >      $sp <- $sp-4
> >      // load return address:
> >      $r3 <- return_label
> >      // store return address on stack:
> >      mem[$sp] <- $r3
> >      // jump to callee:
> >      $pc <- <address_of_function>
> 
> Even though this is internally a jump, it still needs to be
> represented
> as a (call …) rtx in rtl, and emitted using emit_call_insn.
> 
> In other words, the "call" expander must always emit a call_insn
> of some kind.  (But it can emit other instructions too, such as the
> ones you describe above.)
> 
> Richard
> 

Richard,

Thanks for the reply. While what you're saying makes sense, it didn't
solve my problems. The symptoms changed, but didn't completely go away.
At the same time, I realized that - in this architecture - link-
register-style calls are more efficient anyway, so I've changed my call
implementation to that configuration. That got rid of the need for
sloving this particular problem.

So, just to document for people who might be looking at this thread in
the future: this wasn't the complete answer to my problem, but I took a
different route which removed the whole problem class.

Thanks again,
Andras



Reply via email to