From 64c5157f6dcf3ed4595d521ac6b75f595a82e29e Mon Sep 17 00:00:00 2001 From: Frederik Harwath Date: Tue, 10 Dec 2019 16:06:12 +0000 Subject: [PATCH] Use clause locations in OpenACC nested reduction warnings 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 gcc/ * omp-low.c (scan_omp_for): Use clause location in warning. From-SVN: r279168 --- gcc/ChangeLog | 4 ++++ gcc/omp-low.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ed569e481b2..f559d3a6f83 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2019-12-10 Frederik Harwath + + * omp-low.c (scan_omp_for): Use clause location in warning. + 2019-12-10 Richard Sandiford * dwarf2out.c (loc_descriptor): Punt for MODE_VECTOR_BOOL. diff --git a/gcc/omp-low.c b/gcc/omp-low.c index ad26f7918a5..d422c205836 100644 --- a/gcc/omp-low.c +++ b/gcc/omp-low.c @@ -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), -- 2.30.2