Discussion:
[GOOGLE] Handle missing BINFO for LIPO
Xinliang David Li
2014-10-07 18:41:52 UTC
Permalink
Ok (please also guard it with L_IPO_COMP_MODE).

David
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
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
2014-10-07 18:27:18 UTC
Permalink
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 <***@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 | ***@google.com | 408-460-2413
Loading...