[PATCH, Pointer Bounds Checker 21/x] Weakrefs output

Ilya Enkovich enkovich.gnu@gmail.com
Mon Jun 2 15:22:00 GMT 2014


Hi,

This patch prevents output of both instrumented and not instrumented weakref variants.

Thanks,
Ilya
--
gcc/

2014-06-02  Ilya Enkovich  <ilya.enkovich@intel.com>

	* cgraphunit.c (output_weakrefs): If there are both
	instrumented and original versions, output only one
	of them.


diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index c5c3333..ae9e699 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -2111,9 +2111,13 @@ static void
 output_weakrefs (void)
 {
   symtab_node *node;
+  cgraph_node *cnode;
   FOR_EACH_SYMBOL (node)
     if (node->alias
         && !TREE_ASM_WRITTEN (node->decl)
+	&& (!(cnode = dyn_cast <cgraph_node> (node))
+	    || !cnode->instrumented_version
+	    || !TREE_ASM_WRITTEN (cnode->instrumented_version->decl))
 	&& node->weakref)
       {
 	tree target;



More information about the Gcc-patches mailing list