This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [LTO][PATCH] Fix another undefined reference problem.


2008/12/11 Doug Kwan (???) <dougkwan@google.com>:

>    This patch fixes another problem where DECLs of unemitted
> functions are written as exportable in the IL.  The previous code used
> gimple_body to check for availability of function bodies and that was
> wrong.

Sorry for having missed that.  I should've suggested using
gimple_has_body_p().  This predicate will return true if the functions
has a gimple body whether in CFG form or not.

> +static bool
> +cp_fix_function_decl_p (tree decl)
> +{
> +  /* Skip if DECL is not externally.  */

s/externally/externally visible/

> +  if (!TREE_PUBLIC (decl))
> +    return false;
> +
> +  /* We need to fix DECL if it a appears to be exported but with no
> +     function body.  Thunks do not have CFGs and we may need to
> +     handle them specially later.   */
> +  if ((!DECL_STRUCT_FUNCTION (decl)
> +       || !DECL_STRUCT_FUNCTION (decl)->cfg)

has_gimple_body_p (decl)

> -      /* This should only happen for inlines or implicit instanitations
> -	 which are not emitted.  When we reach here,  we should have read
> -	 the EOF and expanded all needed functions.  */
> -      gcc_assert ((DECL_DECLARED_INLINE_P (t)
> -		   || DECL_IMPLICIT_INSTANTIATION (t))
> -		  && at_eof);
> -

Why are you removing this assertion?  Also, why is it not necessary to check
for DECL_INTERFACE_KNOWN anymore?


Thanks.  Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]