This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Clear DECL_LANG_SPECIFIC after changing arguments (PR tree-optimization/60002)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: Jason Merrill <jason at redhat dot com>, Jan Hubicka <hubicka at ucw dot cz>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 4 Feb 2014 13:56:39 +0100
- Subject: Re: [PATCH] Clear DECL_LANG_SPECIFIC after changing arguments (PR tree-optimization/60002)
- Authentication-results: sourceware.org; auth=none
- References: <20140204123743 dot GI12671 at tucnak dot redhat dot com> <alpine dot LSU dot 2 dot 11 dot 1402041341520 dot 29326 at zhemvz dot fhfr dot qr>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Feb 04, 2014 at 01:43:01PM +0100, Richard Biener wrote:
> On Tue, 4 Feb 2014, Jakub Jelinek wrote:
>
> > Hi!
> >
> > As described in the PR, while build_function_decl_skip_args
> > takes care of changing the type from METHOD_TYPE to FUNCTION_TYPE
> > if removing first argument (this), the FE may have other special arguments
> > that it is aware of (such as in-charge etc.) and if the this argument
> > is not removed, but the other arguments are, then the FE can crash
> > upon seeing such methods.
> >
> > Fixed by clearing DECL_LANG_SPECIFIC if we remove any arguments.
> >
> > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?
>
> Ok, but shouldn't we do that in the copy_node case as well? Two
> places look like
>
> /* Make a new FUNCTION_DECL tree node */
> if (!args_to_skip)
> new_decl = copy_node (old_decl);
> else
> new_decl = build_function_decl_skip_args (old_decl, args_to_skip,
> false);
>
> it's no longer a FE created function after all?
It is not a FE created function then, sure, but if we don't remove
any arguments, at least the issue the patch is fixing isn't a problem there.
Jakub