Use clause locations in OpenACC nested reduction warnings
authorFrederik Harwath <frederik@codesourcery.com>
Tue, 10 Dec 2019 16:06:12 +0000 (16:06 +0000)
committerFrederik Harwath <frederik@gcc.gnu.org>
Tue, 10 Dec 2019 16:06:12 +0000 (16:06 +0000)
Since the Fortran front-end now sets the clause locations correctly, we can
emit warnings with more precise locations if we encounter conflicting
operations for a variable in reduction clauses.

2019-12-10  Frederik Harwath  <frederik@codesourcery.com>

gcc/
* omp-low.c (scan_omp_for): Use clause location in warning.

From-SVN: r279168

gcc/ChangeLog
gcc/omp-low.c

index ed569e481b251565cfc870000b005b7478f915d7..f559d3a6f8398e0170a04840e2f57bddf1182e24 100644 (file)
@@ -1,3 +1,7 @@
+2019-12-10  Frederik Harwath  <frederik@codesourcery.com>
+
+       * omp-low.c (scan_omp_for): Use clause location in warning.
+
 2019-12-10  Richard Sandiford  <richard.sandiford@arm.com>
 
        * dwarf2out.c (loc_descriptor): Punt for MODE_VECTOR_BOOL.
index ad26f7918a5485ffbd07f93aa90b878245ceaabc..d422c205836c962dca949dcbced8d084dd47960e 100644 (file)
@@ -2473,7 +2473,7 @@ scan_omp_for (gomp_for *stmt, omp_context *outer_ctx)
              tree_code outer_op = OMP_CLAUSE_REDUCTION_CODE (outer_clause);
              if (outer_var == local_var && outer_op != local_op)
                {
-                 warning_at (gimple_location (stmt), 0,
+                 warning_at (OMP_CLAUSE_LOCATION (local_clause), 0,
                              "conflicting reduction operations for %qE",
                              local_var);
                  inform (OMP_CLAUSE_LOCATION (outer_clause),