This is the mail archive of the 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]

Re: RFA: non-const libcalls

On Tue, May 08, 2001 at 01:13:38AM -0700, Mark Mitchell wrote:
> Unfortunately, the libcall-generation goo sets CONST_CALL_P
> unconditionally in emit_libcall_block.

No it doesn't.  True, it defaults to const for LCT_CONST,
but it is supposed to get cleared here:

  /* If this kind of value comes back in memory,
     decide where in memory it should come back.  */
  if (outmode != VOIDmode && aggregate_value_p (type_for_mode (outmode, 0)))
      /* This call returns a big structure.  */
      flags &= ~(ECF_CONST | ECF_PURE);

But clearly this isn't happening, as otherwise we wouldn't get here:

  if ((flags & (ECF_CONST | ECF_PURE))
      && valreg != 0 && GET_CODE (valreg) != PARALLEL)
      emit_libcall_block (insns, temp, valreg, note);

> (Oddly, we do attach CALL_INSN_FUNCTION_USAGE notes indicating that
> the *arguments* are clobbered -- even though they aren't.

They might be.  That memory is available to the callee as a
home for that varaible.  If the variable is modified within
the callee, it is allowed to spill the value there instead 
of in a new spot in the stack frame.

> The TeXinfo documentation says that CALL_INSN_FUNCTION_USAGE should only
> have CLOBBERs for hard registers, but we go ahead and put MEMs there too.
> What's up with all that?)

Huh.  I could have sworn it mentioned memories.  Certainly this
practice was not introduced recently...


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