http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55848



Richard Biener <rguenth at gcc dot gnu.org> changed:



           What    |Removed                     |Added

----------------------------------------------------------------------------

             Status|NEW                         |ASSIGNED

         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org

                   |gnu.org                     |



--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-02 
15:30:45 UTC ---

The builtin does not prevail over the extern decl for some reason (but it's in

the symtab of course).  builtins have LDPR_UNKNOWN resolution, the extern

has LDPR_RESOLVED_DYN.



So we end up with no prevailing decl ... and in



  /* If there's not a prevailing symbol yet it's an external reference.

     Happens a lot during ltrans.  Choose the first symbol with a

     cgraph or a varpool node.  */

  if (!prevailing)

    {

      prevailing = first;

      /* For variables chose with a priority variant with vnode

         attached (i.e. from unit where external declaration of

         variable is actually used).

         When there are multiple variants, chose one with size.

         This is needed for C++ typeinfos, for example in

         lto/20081204-1 there are typeifos in both units, just

         one of them do have size.  */

      if (TREE_CODE (prevailing->symbol.decl) == VAR_DECL)

        {

          for (e = prevailing->symbol.next_sharing_asm_name;

               e; e = e->symbol.next_sharing_asm_name)

            if (!COMPLETE_TYPE_P (TREE_TYPE (prevailing->symbol.decl))

                && COMPLETE_TYPE_P (TREE_TYPE (e->symbol.decl)))

              prevailing = e;

        }

    }



where we probably should prefer builtins as we never replace those

when fixing up the cgraph.



Mine.

Reply via email to