This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fixup fix for PR45957
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 15 Oct 2010 17:14:41 +0200 (CEST)
- Subject: [PATCH] Fixup fix for PR45957
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2010-10-15 Richard Guenther <rguenther@suse.de>
* tree.c (free_lang_data_in_decl): Clear DECL_INITIAL
for automatic variables again.
* g++.dg/lto/20101015-1_0.C: New testcase.
Index: gcc/tree.c
===================================================================
*** gcc/tree.c (revision 165504)
--- gcc/tree.c (working copy)
*************** free_lang_data_in_decl (tree decl)
*** 4513,4520 ****
}
else if (TREE_CODE (decl) == VAR_DECL)
{
! if (DECL_EXTERNAL (decl)
! && (!TREE_STATIC (decl) || !TREE_READONLY (decl)))
DECL_INITIAL (decl) = NULL_TREE;
}
else if (TREE_CODE (decl) == TYPE_DECL)
--- 4525,4533 ----
}
else if (TREE_CODE (decl) == VAR_DECL)
{
! if ((DECL_EXTERNAL (decl)
! && (!TREE_STATIC (decl) || !TREE_READONLY (decl)))
! || (decl_function_context (decl) && !TREE_STATIC (decl)))
DECL_INITIAL (decl) = NULL_TREE;
}
else if (TREE_CODE (decl) == TYPE_DECL)
Index: gcc/testsuite/g++.dg/lto/20101015-1_0.C
===================================================================
*** gcc/testsuite/g++.dg/lto/20101015-1_0.C (revision 0)
--- gcc/testsuite/g++.dg/lto/20101015-1_0.C (revision 0)
***************
*** 0 ****
--- 1,31 ----
+ // { dg-lto-do assemble }
+
+ class DOMString { };
+ class DocumentImpl;
+ class NodeImpl {
+ public:
+ static const DOMString&
+ mapPrefix(const DOMString &prefix, const DOMString &namespaceURI, short nType);
+ static DOMString getXmlnsURIString();
+ };
+ class DOM_Node {
+ public:
+ enum NodeType { ATTRIBUTE_NODE = 2 };
+ };
+ class AttrImpl: public NodeImpl {
+ public:
+ AttrImpl(DocumentImpl *ownerDocument, const DOMString &aName);
+ };
+ class AttrNSImpl: public AttrImpl {
+ AttrNSImpl(DocumentImpl *ownerDoc, const DOMString &namespaceURI, const DOMString &qualifiedName);
+ };
+ AttrNSImpl::AttrNSImpl(DocumentImpl *ownerDoc,
+ const DOMString &fNamespaceURI,
+ const DOMString &qualifiedName)
+ : AttrImpl(ownerDoc, qualifiedName)
+ {
+ DOMString xmlnsURI = NodeImpl::getXmlnsURIString();
+ DOMString prefix;
+ bool xmlnsAlone = false;
+ const DOMString& URI = xmlnsAlone ? xmlnsURI : mapPrefix(prefix, fNamespaceURI, DOM_Node::ATTRIBUTE_NODE);
+ }