[dragonegg] r208003 - Fix c/InternFunctionWeakref.c.
Rafael Espindola
rafael.espindola at gmail.com
Mon May 5 14:41:04 PDT 2014
Author: rafael
Date: Mon May 5 16:41:04 2014
New Revision: 208003
URL: http://llvm.org/viewvc/llvm-project?rev=208003&view=rev
Log:
Fix c/InternFunctionWeakref.c.
The test was failing when building with gcc 4.8. It looks like weakrefs are
reachable via emit_cgrah_aliases and emit_cgraph_weakref. This causes us to
try to use rauw twice, causing an assert when we get a this->rauw(this).
The patch simply skips weakrefs in emit_cgrah_aliases.
Modified:
dragonegg/trunk/src/Backend.cpp
Modified: dragonegg/trunk/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/trunk/src/Backend.cpp?rev=208003&r1=208002&r2=208003&view=diff
==============================================================================
--- dragonegg/trunk/src/Backend.cpp (original)
+++ dragonegg/trunk/src/Backend.cpp Mon May 5 16:41:04 2014
@@ -1655,12 +1655,16 @@ static void emit_cgraph_aliases(struct c
struct ipa_ref *ref;
for (int i = 0;
ipa_ref_list_referring_iterate(&cgraph_symbol(node)->ref_list, i, ref);
- i++)
- if (ref->use == IPA_REF_ALIAS) {
- struct cgraph_node *alias = ipa_ref_referring_node(ref);
- emit_alias(cgraph_symbol(alias)->decl, alias->thunk.alias);
- emit_cgraph_aliases(alias);
- }
+ i++) {
+ if (ref->use != IPA_REF_ALIAS)
+ continue;
+ struct cgraph_node *alias = ipa_ref_referring_node(ref);
+ if (lookup_attribute("weakref",
+ DECL_ATTRIBUTES(cgraph_symbol(alias)->decl)))
+ continue;
+ emit_alias(cgraph_symbol(alias)->decl, alias->thunk.alias);
+ emit_cgraph_aliases(alias);
+ }
#endif
}
More information about the llvm-commits
mailing list