[Bug tree-optimization/45957] [4.6 Regression] g++.dg/ext/fnname3.C FAILs with -flto/-fwhopr

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Oct 14 15:14:00 GMT 2010


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2010.10.14 15:14:34
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #2 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-10-14 15:14:34 UTC ---
This happens because we clear DECL_INITIAL in free-lang-data and appearantly
S::S which is the context of __func__ is DECL_ABSTRACT ...

Surely an artifact of the C++ constructor/destructor cloning.

We could simply remove

 if (TREE_CODE (decl) == VAR_DECL)
   {
     tree context = DECL_CONTEXT (decl);

     if (context)
       {
         enum tree_code code = TREE_CODE (context);
         if (code == FUNCTION_DECL && DECL_ABSTRACT (context))
           {
             /* Do not clear the decl context here, that will promote
                all vars to global ones.  */
             DECL_INITIAL (decl) = NULL_TREE;
           }
       }
   }

from free-lang-data.



More information about the Gcc-bugs mailing list