This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][LTO] Fix EH tree corruptions
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Richard Guenther <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 25 Aug 2009 21:27:24 +0200
- Subject: Re: [PATCH][LTO] Fix EH tree corruptions
- References: <alpine.LNX.2.00.0908251756220.28140@zhemvz.fhfr.qr>
>
> This fixes gimple verification when cc1plus and lto1 do not agree
> on whether a stmt may throw internal because of different answers
> from inlinable_call_p.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu, installed on
> the branch.
>
> Richard.
>
> 2009-08-25 Richard Guenther <rguenther@suse.de>
>
> * tree-eh.c (inlinable_call_p): Assume calls might be inlined
> when building with -flto or -fwhopr.
>
> Index: gcc/tree-eh.c
> ===================================================================
> *** gcc/tree-eh.c (revision 151056)
> --- gcc/tree-eh.c (working copy)
> *************** inlinable_call_p (gimple stmt)
> *** 1995,2000 ****
> --- 1995,2003 ----
> decl = gimple_call_fndecl (stmt);
> if (!decl)
> return true;
> + /* The function body might become available during link time. */
> + if (flag_lto || flag_whopr)
> + return true;
Hmm, this is bit overactive for static function in the (rare) case we
know there is static function and it is not inlinable.
> if (cgraph_function_flags_ready
> && cgraph_function_body_availability (cgraph_node (decl))
> < AVAIL_OVERWRITABLE)
Perhaps it can be best handled in general by adding AVAIL_MAYBE_LATER in
between OVERWRITABLE and NOT_AVAILABLE? I guess there are couple other
places where we want to delay decision until we know if function body
will be there or not like this.
Honza