Fix "[openmp] Set location for taskloop stmts"
authorTom de Vries <tdevries@suse.de>
Fri, 18 Mar 2022 15:19:25 +0000 (16:19 +0100)
committerTom de Vries <tdevries@suse.de>
Fri, 18 Mar 2022 15:27:28 +0000 (16:27 +0100)
I accidentally committed an outdated version of patch "[openmp] Set location
for taskloop stmts".

Fix this by adding the missing changes.

gcc/ChangeLog:

2022-03-18  Tom de Vries  <tdevries@suse.de>

* gimplify.cc (gimplify_omp_for): Set location using 'input_location'.
Set gfor location only when dealing with a OMP_TASKLOOP.

gcc/gimplify.cc

index c465896..f62f150 100644 (file)
@@ -13178,7 +13178,6 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
   gfor = gimple_build_omp_for (for_body, kind, OMP_FOR_CLAUSES (orig_for_stmt),
                               TREE_VEC_LENGTH (OMP_FOR_INIT (for_stmt)),
                               for_pre_body);
-  gimple_set_location (gfor, EXPR_LOCATION (*expr_p));
   if (orig_for_stmt != for_stmt)
     gimple_omp_for_set_combined_p (gfor, true);
   if (gimplify_omp_ctxp
@@ -13359,10 +13358,11 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
       *gtask_clauses_ptr = NULL_TREE;
       *gforo_clauses_ptr = NULL_TREE;
       BITMAP_FREE (lastprivate_uids);
+      gimple_set_location (gfor, input_location);
       g = gimple_build_bind (NULL_TREE, gfor, NULL_TREE);
       g = gimple_build_omp_task (g, task_clauses, NULL_TREE, NULL_TREE,
                                 NULL_TREE, NULL_TREE, NULL_TREE);
-      gimple_set_location (g, EXPR_LOCATION (*expr_p));
+      gimple_set_location (g, input_location);
       gimple_omp_task_set_taskloop_p (g, true);
       g = gimple_build_bind (NULL_TREE, g, NULL_TREE);
       gomp_for *gforo