aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.cc
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2023-11-24 15:31:08 +0100
committerTobias Burnus <tobias@codesourcery.com>2023-11-24 15:31:08 +0100
commit449b6b817ed76173e6475debd02b195ea9dab0a0 (patch)
treefb600916fe66e127887ae99bcfb4cc34bd868bd5 /gcc/gimplify.cc
parent439779bacee869643c93a4710a29f89ad031ee4a (diff)
downloadgcc-449b6b817ed76173e6475debd02b195ea9dab0a0.zip
gcc-449b6b817ed76173e6475debd02b195ea9dab0a0.tar.gz
gcc-449b6b817ed76173e6475debd02b195ea9dab0a0.tar.bz2
OpenMP: Add -Wopenmp and use it
The new warning has two purposes: First, it makes clearer to the user that it is about OpenMP and, secondly and more importantly, it permits to use -Wno-openmp. The newly added -Wopenmp is enabled by default and replaces the '0' (always warning) in several OpenMP-related warning calls. For code shared with OpenACC, it only uses OPT_Wopenmp for 'flag_openmp | flag_openmp_simd'. gcc/c-family/ChangeLog: * c.opt (Wopenmp): Add, enable by default. gcc/c/ChangeLog: * c-parser.cc (c_parser_omp_clause_num_threads, c_parser_omp_clause_num_tasks, c_parser_omp_clause_grainsize, c_parser_omp_clause_priority, c_parser_omp_clause_schedule, c_parser_omp_clause_num_teams, c_parser_omp_clause_thread_limit, c_parser_omp_clause_dist_schedule, c_parser_omp_depobj, c_parser_omp_scan_loop_body, c_parser_omp_assumption_clauses): Add OPT_Wopenmp to warning_at. gcc/cp/ChangeLog: * parser.cc (cp_parser_omp_clause_dist_schedule, cp_parser_omp_scan_loop_body, cp_parser_omp_assumption_clauses, cp_parser_omp_depobj): Add OPT_Wopenmp to warning_at. * semantics.cc (finish_omp_clauses): Likewise. gcc/ChangeLog: * doc/invoke.texi (-Wopenmp): Add. * gimplify.cc (gimplify_omp_for): Add OPT_Wopenmp to warning_at. * omp-expand.cc (expand_omp_ordered_sink): Likewise. * omp-general.cc (omp_check_context_selector): Likewise. * omp-low.cc (scan_omp_for, check_omp_nesting_restrictions, lower_omp_ordered_clauses): Likewise. * omp-simd-clone.cc (simd_clone_clauses_extract): Likewise. gcc/fortran/ChangeLog: * lang.opt (Wopenmp): Add, enabled by dafault and documented in C. * openmp.cc (gfc_match_omp_declare_target, resolve_positive_int_expr, resolve_nonnegative_int_expr, resolve_omp_clauses, gfc_resolve_omp_do_blocks): Use OPT_Wopenmp with gfc_warning{,_now}.
Diffstat (limited to 'gcc/gimplify.cc')
-rw-r--r--gcc/gimplify.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc
index d52d71b..02f85e7 100644
--- a/gcc/gimplify.cc
+++ b/gcc/gimplify.cc
@@ -14382,7 +14382,7 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
OMP_CLAUSE_LASTPRIVATE))
if (OMP_CLAUSE_DECL (c3) == decl)
{
- warning_at (OMP_CLAUSE_LOCATION (c3), 0,
+ warning_at (OMP_CLAUSE_LOCATION (c3), OPT_Wopenmp,
"conditional %<lastprivate%> on loop "
"iterator %qD ignored", decl);
OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c3) = 0;
@@ -14490,7 +14490,7 @@ gimplify_omp_for (tree *expr_p, gimple_seq *pre_p)
OMP_CLAUSE_LASTPRIVATE))
if (OMP_CLAUSE_DECL (c3) == decl)
{
- warning_at (OMP_CLAUSE_LOCATION (c3), 0,
+ warning_at (OMP_CLAUSE_LOCATION (c3), OPT_Wopenmp,
"conditional %<lastprivate%> on loop "
"iterator %qD ignored", decl);
OMP_CLAUSE_LASTPRIVATE_CONDITIONAL (c3) = 0;