This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [tree-ssa] Make tail-call work on SSA form
- From: law at redhat dot com
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Jason Merrill <jason at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>, Richard Henderson <rth at redhat dot com>, Diego Novillo <dnovillo at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 18 Nov 2003 16:18:37 -0700
- Subject: Re: [tree-ssa] Make tail-call work on SSA form
- Reply-to: law at redhat dot com
In message <20031118205610.GZ11681@kam.mff.cuni.cz>, Jan Hubicka writes:
>> On Tue, 18 Nov 2003 19:41:34 +0100, Jan Hubicka <hubicka@ucw.cz> wrote:
>>
>> > It is still needed because when we do not set TREE_ADDRESABLE, we end up
>> > putting arrays/structures into registers
>>
>> Why?
>
>This is how expanders work:
> {
> /* Automatic variable that can go in a register. */
> int unsignedp = TREE_UNSIGNED (type);
> enum machine_mode reg_mode
> = promote_mode (type, DECL_MODE (decl), &unsignedp, 0);
>
> SET_DECL_RTL (decl, gen_reg_rtx (reg_mode));
>
> if (!DECL_ARTIFICIAL (decl))
> mark_user_reg (DECL_RTL (decl));
>
> if (POINTER_TYPE_P (type))
> mark_reg_pointer (DECL_RTL (decl),
> TYPE_ALIGN (TREE_TYPE (TREE_TYPE (decl))));
>
> maybe_set_unchanging (DECL_RTL (decl), decl);
>
> /* If something wants our address, try to use ADDRESSOF. */
> if (TREE_ADDRESSABLE (decl))
> put_var_into_stack (decl, /*rescan=*/false);
> }
>We still attempt to put addressable variable into register via addressof
>code but that beast should go away.
Yes, that's one of the cleanups we need to make. The tree-ssa optimizers
(in theory) only leave TREE_ADDRESSABLE set if the object really needs to
be addressable.
ie, by the time we get to the expanders we know if an object must be in
memory or not. So the whole mess with ADDRESSOF is pointless.
Jeff