[gomp4.1] Fix up gimple_copy for GIMPLE_OMP_ORDERED clauses

Jakub Jelinek jakub@redhat.com
Tue Oct 13 09:32:00 GMT 2015


Hi!

We forgot to update gimple_copy when clauses were added to
GIMPLE_OMP_ORDERED.  Fixed thusly:

2015-10-13  Jakub Jelinek  <jakub@redhat.com>

	* gimple.c (gimple_copy): Unshare clauses on GIMPLE_OMP_ORDERED.

--- gcc/gimple.c.jj	2015-10-13 09:39:21.000000000 +0200
+++ gcc/gimple.c	2015-10-13 11:25:54.086967126 +0200
@@ -1792,6 +1792,12 @@ gimple_copy (gimple *stmt)
 	  gimple_omp_critical_set_clauses (as_a <gomp_critical *> (copy), t);
 	  goto copy_omp_body;
 
+	case GIMPLE_OMP_ORDERED:
+	  t = unshare_expr (gimple_omp_ordered_clauses
+				(as_a <gomp_ordered *> (stmt)));
+	  gimple_omp_ordered_set_clauses (as_a <gomp_ordered *> (copy), t);
+	  goto copy_omp_body;
+
 	case GIMPLE_OMP_SECTIONS:
 	  t = unshare_expr (gimple_omp_sections_clauses (stmt));
 	  gimple_omp_sections_set_clauses (copy, t);
@@ -1805,7 +1811,6 @@ gimple_copy (gimple *stmt)
 	case GIMPLE_OMP_SECTION:
 	case GIMPLE_OMP_MASTER:
 	case GIMPLE_OMP_TASKGROUP:
-	case GIMPLE_OMP_ORDERED:
 	copy_omp_body:
 	  new_seq = gimple_seq_copy (gimple_omp_body (stmt));
 	  gimple_omp_set_body (copy, new_seq);

	Jakub



More information about the Gcc-patches mailing list