Xinliang David Li
2014-10-07 18:41:52 UTC
Ok (please also guard it with L_IPO_COMP_MODE).
David
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. */
--
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. */
--