Add support for sparc-wrs-vxworks
Eric Botcazou
ebotcazou@libertysurf.fr
Wed May 9 10:42:00 GMT 2007
> * config/sparc/sparc.h: Include vxworks-dummy.h.
<grumble>
I see that it's the same for other archs, but this is *really* not pretty:
1. The preferred mechanism for target includes is tm_file in config.gcc.
2. This sets a bad precedent for future ports.
</grumble>
> +/* Emit a PARALLEL call instruction with the contents given by VEC.
> + MEM is the memory reference associated with the call target. */
> +
> +void
> +sparc_emit_call_insn (rtvec vec, rtx mem)
> +{
> + rtx x, insn;
> +
> + insn = emit_call_insn (gen_rtx_PARALLEL (VOIDmode, vec));
> + gcc_assert (MEM_P (mem));
> + if (TARGET_VXWORKS_RTP && flag_pic)
> + {
> + /* The PIC register is live on entry to VxWorks PIC PLT entries. */
> + x = XEXP (mem, 0);
Please change the prototype of sparc_emit_call_insn to make it ressemble that
of emit_call_insn. And remove the gcc_assert (and merge it with the existing
gcc_assert in the call and call_value patterns).
> + VxWorks PIC PLT entries require the global pointer to be initialized
> + on entry. We therefore can't emit sibling calls to them. */
> static bool
> sparc_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
> {
> return (decl
> && flag_delayed_branch
> - && (TARGET_ARCH64 || ! current_function_returns_struct));
> + && (TARGET_ARCH64 || ! current_function_returns_struct)
> + && (!TARGET_VXWORKS_RTP
> + || !flag_pic
> + || targetm.binds_local_p (decl)));
> }
&& !(TARGET_VXWORKS_RTP
&& flag_pic
&& !targetm.binds_local_p (decl))
OK with these changes.
--
Eric Botcazou
More information about the Gcc-patches
mailing list