+2011-01-26 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47190
+ * cgraphunit.c (process_common_attributes): New function.
+ (process_function_and_variable_attributes): Use it.
+
2011-01-26 Richard Guenther <rguenther@suse.de>
PR lto/47423
current_function_decl = save;
}
+/* Process attributes common for vars and functions. */
+
+static void
+process_common_attributes (tree decl)
+{
+ tree weakref = lookup_attribute ("weakref", DECL_ATTRIBUTES (decl));
+
+ if (weakref && !lookup_attribute ("alias", DECL_ATTRIBUTES (decl)))
+ {
+ warning_at (DECL_SOURCE_LOCATION (decl), OPT_Wattributes,
+ "%<weakref%> attribute should be accompanied with"
+ " an %<alias%> attribute");
+ DECL_WEAK (decl) = 0;
+ remove_attribute ("weakref", DECL_ATTRIBUTES (decl));
+ }
+}
+
/* Look for externally_visible and used attributes and mark cgraph nodes
accordingly.
else if (node->local.finalized)
cgraph_mark_needed_node (node);
}
+ process_common_attributes (decl);
}
for (vnode = varpool_nodes; vnode != first_var; vnode = vnode->next)
{
else if (vnode->finalized)
varpool_mark_needed_node (vnode);
}
+ process_common_attributes (decl);
}
}
+2011-01-26 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/47190
+ * gcc.dg/attr-weakref-3.c: New testcase.
+
2011-01-26 Dave Korn <dave.korn.cygwin@gmail.com>
PR c++/43601