This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: non-const libcalls
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: RFA: non-const libcalls
- From: Richard Henderson <rth at redhat dot com>
- Date: Tue, 8 May 2001 12:48:54 -0700
- Cc: gcc at gcc dot gnu dot org, Bernd Schmidt <bernds at cygnus dot co dot uk>
- References: <20010508011338O.mitchell@codesourcery.com>
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...
r~