[tuples] remap_gimple_stmt: handle omp cases

Aldy Hernandez aldyh@redhat.com
Thu May 29 20:24:00 GMT 2008


This handles remapping of OMP constructs that have a body.  The patch
below fixes a handful of regressions.

Aldy

	* tree-inline.c (remap_gimple_stmt): Handle GIMPLE_OMP_* cases.

Index: tree-inline.c
===================================================================
--- tree-inline.c	(revision 136168)
+++ tree-inline.c	(working copy)
@@ -1090,14 +1090,56 @@ remap_gimple_stmt (gimple stmt, copy_bod
 	  copy = gimple_build_wce (s1);
 	  break;
 
-	  /* FIXME tuples.  */
+	case GIMPLE_OMP_PARALLEL:
+	  s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+	  copy = gimple_build_omp_parallel
+	           (s1,
+		    gimple_omp_parallel_clauses (stmt),
+		    gimple_omp_parallel_child_fn (stmt),
+		    gimple_omp_parallel_data_arg (stmt));
+	  break;
+
 	case GIMPLE_OMP_FOR:
+	  s1 = remap_gimple_seq (gimple_omp_body (stmt), id);
+	  s2 = remap_gimple_seq (gimple_omp_for_pre_body (stmt), id);
+	  copy = gimple_build_omp_for
+	           (s1,
+		    gimple_omp_for_clauses (stmt),
+		    gimple_omp_for_index (stmt),
+		    gimple_omp_for_initial (stmt),
+		    gimple_omp_for_final (stmt),
+		    gimple_omp_for_incr (stmt),
+		    s2,
+		    gimple_omp_for_cond (stmt));
+	  break;
+
 	case GIMPLE_OMP_MASTER:
+	  s1 = gimple_omp_body (stmt);
+	  copy = gimple_build_omp_master (s1);
+	  break;
+
 	case GIMPLE_OMP_ORDERED:
+	  s1 = gimple_omp_body (stmt);
+	  copy = gimple_build_omp_ordered (s1);
+	  break;
+
 	case GIMPLE_OMP_SECTION:
-	case GIMPLE_OMP_PARALLEL:
+	  s1 = gimple_omp_body (stmt);
+	  copy = gimple_build_omp_section (s1);
+	  break;
+
 	case GIMPLE_OMP_SECTIONS:
+	  s1 = gimple_omp_body (stmt);
+	  copy = gimple_build_omp_sections
+	           (s1, gimple_omp_sections_clauses (stmt));
+	  break;
+
 	case GIMPLE_OMP_SINGLE:
+	  s1 = gimple_omp_body (stmt);
+	  copy = gimple_build_omp_single
+	           (s1, gimple_omp_single_clauses (stmt));
+	  break;
+
 	default:
 	  gcc_unreachable ();
 	}



More information about the Gcc-patches mailing list