This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix gomp failures introduced by my prevoius patch


Hi,
I managed to screw patch order and introduce a libgomp failures.  The problem
is that unreachable node removal (that is needed for correctness of LTO symbol
tables) results in cgraph removing decl functions produced by OMP code since we
do not explicitely represent the references for OMP child functions and they live
in callgraph unanalyzed till the lowering.

This patch sort of fixes it by adding reference edges that prevent callgraph from
sweeping away the function body.

Bootstrapping/regtesting x86_64-linux, will commit it once it finish.
My apologizes for the breakage.

Honza

	* cgraphbuild.c (build_cgraph_edges): Handle OMP using references.
Index: cgraphbuild.c
===================================================================
--- cgraphbuild.c	(revision 165985)
+++ cgraphbuild.c	(working copy)
@@ -361,16 +361,19 @@ build_cgraph_edges (void)
 	      && gimple_omp_parallel_child_fn (stmt))
 	    {
 	      tree fn = gimple_omp_parallel_child_fn (stmt);
-	      cgraph_mark_needed_node (cgraph_node (fn));
+	      ipa_record_reference (node, NULL, cgraph_node (fn),
+				    NULL, IPA_REF_ADDR, stmt);
 	    }
 	  if (gimple_code (stmt) == GIMPLE_OMP_TASK)
 	    {
 	      tree fn = gimple_omp_task_child_fn (stmt);
 	      if (fn)
-		cgraph_mark_needed_node (cgraph_node (fn));
+		ipa_record_reference (node, NULL, cgraph_node (fn),
+				      NULL, IPA_REF_ADDR, stmt);
 	      fn = gimple_omp_task_copy_fn (stmt);
 	      if (fn)
-		cgraph_mark_needed_node (cgraph_node (fn));
+		ipa_record_reference (node, NULL, cgraph_node (fn),
+				      NULL, IPA_REF_ADDR, stmt);
 	    }
 	}
       for (gsi = gsi_start (phi_nodes (bb)); !gsi_end_p (gsi); gsi_next (&gsi))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]