RFA: non-const libcalls
Alexandre Oliva
aoliva@redhat.com
Tue May 8 02:44:00 GMT 2001
On May 8, 2001, Mark Mitchell <mark@codesourcery.com> wrote:
> Unfortunately, the libcall-generation goo sets CONST_CALL_P
> unconditionally in emit_libcall_block. This is bogus because the
> libcall writes to memory -- namely the output area for the result of
> the computation. The function is definitely not const according to
> the definitions in the manual which require that the function not read
> from memory pointed to by pointer arguments.
> How should we arrange not to set the bit in emit_libcall_block?
Perhaps passing it a boolean flag with the result of:
(mem_value != 0 && struct_value_rtx != 0 && ! pcc_struct_value)
> 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?
The USEs were added to prevent flow from considering dead the stores
into stack slots used to hold arguments passed by transparent
reference, and the clobbers prevent us from assuming such arguments
from remaining unchanged when they're not callee-copied. I'm not 100%
sure they're necessary, but they're definitely sound.
It seems that I forgot to update the docs, though. Ok to install?
Branch and mainline?
More information about the Gcc
mailing list