This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[GOOGLE] Treat artificial from aux modules as non-external
- From: Teresa Johnson <tejohnson at google dot com>
- To: David Li <davidxl at google dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 16 Oct 2014 09:16:55 -0700
- Subject: [GOOGLE] Treat artificial from aux modules as non-external
- Authentication-results: sourceware.org; auth=none
The following patch fixes a LIPO issue with a virtual implicitly
instantiated destructor from an aux module that was needed when we
devirtualized a call from the primary module, but it was not available
(not promoted to global) in aux module since it is DECL_ARTIFICIAL.
Fixes compilation issue, passes regression tests. Ok for google/4_9?
Thanks,
Teresa
2014-10-16 Teresa Johnson <tejohnson@google.com>
Google ref b/17971995.
* l-ipo.c (cgraph_is_aux_decl_external): Artificial functions may
not be available in primary module.
Index: l-ipo.c
===================================================================
--- l-ipo.c (revision 216286)
+++ l-ipo.c (working copy)
@@ -1140,8 +1140,11 @@ cgraph_is_aux_decl_external (struct cgraph_node *n
/* Comdat or weak functions in aux modules are not external --
there is no guarantee that the definitition will be emitted
- in the primary compilation of this auxiliary module. */
- if (DECL_COMDAT (decl) || DECL_WEAK (decl))
+ in the primary compilation of this auxiliary module.
+ Functions marked artificial (e.g. an implicitly instantiated virtual
+ destructor) are also not guaranteed to be available in the primary module,
+ as they are not promoted by process_module_scope_static_func. */
+ if (DECL_COMDAT (decl) || DECL_WEAK (decl) || DECL_ARTIFICIAL (decl))
return false;
/* virtual functions won't be deleted in the primary module. */
--
Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413