This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [GOOGLE] Handle missing BINFO for LIPO
- From: Xinliang David Li <davidxl at google dot com>
- To: Teresa Johnson <tejohnson at google dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 7 Oct 2014 11:41:52 -0700
- Subject: Re: [GOOGLE] Handle missing BINFO for LIPO
- Authentication-results: sourceware.org; auth=none
- References: <CAAe5K+UUWJ1xFRPhV69u4yuRwBDovQQ_pMmBLVRkAKogxfsURQ at mail dot gmail dot com>
Ok (please also guard it with L_IPO_COMP_MODE).
David
On Tue, Oct 7, 2014 at 11:27 AM, Teresa Johnson <tejohnson@google.com> wrote:
> We may have missing BINFO on a type if that type is a builtin, since
> in LIPO mode we will reset builtin types to their original tree nodes
> before parsing subsequent modules. Handle incomplete information by
> returning false so we won't put an entry in the type inheritance graph
> for optimization.
>
> Passes regression tests. Ok for google branches?
>
> Teresa
>
> 2014-10-07 Teresa Johnson <tejohnson@google.com>
>
> Google ref b/16511102.
> * ipa-devirt.c (polymorphic_type_binfo_p): Handle missing BINFO.
>
> Index: ipa-devirt.c
> ===================================================================
> --- ipa-devirt.c (revision 215830)
> +++ ipa-devirt.c (working copy)
> @@ -177,7 +177,10 @@ static inline bool
> polymorphic_type_binfo_p (tree binfo)
> {
> /* See if BINFO's type has an virtual table associtated with it. */
> - return BINFO_VTABLE (TYPE_BINFO (BINFO_TYPE (binfo)));
> + tree type_binfo = TYPE_BINFO (BINFO_TYPE (binfo));
> + if (!type_binfo)
> + return false;
> + return BINFO_VTABLE (type_binfo);
> }
>
> /* One Definition Rule hashtable helpers. */
>
>
> --
> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413