[PATCH][C++] Remove auto_var_in_fn langhook

Jakub Jelinek jakub@redhat.com
Tue Aug 21 09:19:00 GMT 2007


On Mon, Aug 20, 2007 at 01:32:11PM +0200, Richard Guenther wrote:
> On Wed, 1 Aug 2007, Mark Mitchell wrote:
> 
> > Richard Guenther wrote:
> > 
> > > 2007-07-26  Richard Guenther  <rguenther@suse.de>
> > > 
> > > 	* langhooks-def.h (lhd_tree_inlining_auto_var_in_fn_p): Remove.
> > > 	(LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P): Likewise.
> > > 	(LANG_HOOKS_TREE_INLINING_INITIALIZER): Remove initializer for
> > > 	auto_var_in_fn_p langhook.
> > > 	* langhooks.c (lhd_tree_inlining_auto_var_in_fn_p): Rename and
> > > 	move ...
> > > 	* tree.c (auto_var_in_fn_p): ... here.
> > > 	(find_var_from_fn): Call auto_var_in_fn_p directly.
> > > 	* langhooks.h (lang_hooks_for_tree_inlining): Remove
> > > 	auto_var_in_fn_p langhook.
> > > 	* tree-inline.c (remap_decls): Call auto_var_in_fn_p directly.
> > > 	(copy_body_r): Likewise.
> > > 	(self_inlining_addr_expr): Likewise.
> > > 	* tree.h (auto_var_in_fn_p): Declare.
> > > 
> > > 	cp/
> > > 	* cp-objcp-common.h (LANG_HOOKS_TREE_INLINING_AUTO_VAR_IN_FN_P):
> > > 	Remove.
> > > 	* cp-tree.h (cp_auto_var_in_fn_p): Remove.
> > > 	* tree.c (cp_auto_var_in_fn_p): Remove.
> > 
> > OK.  I think this means nonstatic_local_decl_p is dead now too, so feel
> > free to remove that as well.
> 
> Right.  Done.

One of the -r127641:127644 changes causes
FAIL: gcc.c-torture/execute/20010119-1.c compilation,  -Os
regression on x86_64-linux.  The inline fn is no longer inlined and as it
is extern inline in gnu89 mode, we get undefined reference.
In this particular case inlining it is a net win even for -Os, as it is
completely optimized out.

	Jakub



More information about the Gcc-patches mailing list