diff mbox

[GOOGLE] Treat artificial from aux modules as non-external

Message ID CAAe5K+Ut0pWH0RdQ2cXWKEyEUbtQkL+2ptxY-pSkK1bMqtWCpg@mail.gmail.com
State New
Headers show

Commit Message

Teresa Johnson Oct. 16, 2014, 4:16 p.m. UTC
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.

Comments

Xinliang David Li Oct. 16, 2014, 4:23 p.m. UTC | #1
Ok if large tests pass.

David

On Thu, Oct 16, 2014 at 9:16 AM, Teresa Johnson <tejohnson@google.com> wrote:
> 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
diff mbox

Patch

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.  */