gccint: Calls

1 
1 14.20 RTL Representation of Function-Call Insns
1 ===============================================
1 
1 Insns that call subroutines have the RTL expression code 'call_insn'.
1 These insns must satisfy special rules, and their bodies must use a
1 special RTL expression code, 'call'.
1 
1  A 'call' expression has two operands, as follows:
1 
1      (call (mem:FM ADDR) NBYTES)
1 
1 Here NBYTES is an operand that represents the number of bytes of
1 argument data being passed to the subroutine, FM is a machine mode
1 (which must equal as the definition of the 'FUNCTION_MODE' macro in the
1 machine description) and ADDR represents the address of the subroutine.
1 
1  For a subroutine that returns no value, the 'call' expression as shown
1 above is the entire body of the insn, except that the insn might also
1 contain 'use' or 'clobber' expressions.
1 
1  For a subroutine that returns a value whose mode is not 'BLKmode', the
1 value is returned in a hard register.  If this register's number is R,
1 then the body of the call insn looks like this:
1 
1      (set (reg:M R)
1           (call (mem:FM ADDR) NBYTES))
1 
1 This RTL expression makes it clear (to the optimizer passes) that the
1 appropriate register receives a useful value in this insn.
1 
1  When a subroutine returns a 'BLKmode' value, it is handled by passing
1 to the subroutine the address of a place to store the value.  So the
1 call insn itself does not "return" any value, and it has the same RTL
1 form as a call that returns nothing.
1 
1  On some machines, the call instruction itself clobbers some register,
1 for example to contain the return address.  'call_insn' insns on these
1 machines should have a body which is a 'parallel' that contains both the
1 'call' expression and 'clobber' expressions that indicate which
1 registers are destroyed.  Similarly, if the call instruction requires
1 some register other than the stack pointer that is not explicitly
1 mentioned in its RTL, a 'use' subexpression should mention that
1 register.
1 
1  Functions that are called are assumed to modify all registers listed in
1 the configuration macro 'CALL_USED_REGISTERS' (⇒Register Basics)
1 and, with the exception of 'const' functions and library calls, to
1 modify all of memory.
1 
1  Insns containing just 'use' expressions directly precede the
1 'call_insn' insn to indicate which registers contain inputs to the
1 function.  Similarly, if registers other than those in
1 'CALL_USED_REGISTERS' are clobbered by the called function, insns
1 containing a single 'clobber' follow immediately after the call to
1 indicate which registers.
1