This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] DECL_NO_STATIC_CHAIN -> DECL_STATIC_CHAIN
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Richard Henderson <rth at redhat dot com>, Richard Guenther <rguenther at suse dot de>
- Date: Wed, 23 Sep 2009 23:31:47 +0200
- Subject: Re: [PATCH] DECL_NO_STATIC_CHAIN -> DECL_STATIC_CHAIN
- References: <20090923182949.GS14664@tyan-ft48-01.lab.bos.redhat.com>
> This is something we've been discussing on IRC today. DECL_NO_STATIC_CHAIN
> is ATM quite weird, C++/Ada FEs set it to 1 for new function decls
That cannot be true for Ada, as otherwise the old algorithm in tree-nested.c
would have prevented the compiler from working. The flag is only set for
imported nested functions.
> * gcc-interface/utils.c (gnat_pushdecl): Don't set
> DECL_NO_STATIC_CHAIN.
Not OK, we need the same treatment as C:
{
DECL_CONTEXT (decl) = current_function_decl;
/* Functions imported in another function are not really nested. */
if (TREE_CODE (decl) == FUNCTION_DECL && !TREE_PUBLIC (decl))
DECL_STATIC_CHAIN (decl) = 1;
}
--
Eric Botcazou