aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@gcc.gnu.org>2016-04-06 23:07:21 +0000
committerPatrick Palka <ppalka@gcc.gnu.org>2016-04-06 23:07:21 +0000
commit6b37bdaff18303bdc1042d9b99f11f83ac836c13 (patch)
tree66367b6fb70f7e3bce2174c4c92500acc9eafd3b /gcc/gimplify.c
parent64824205cc9312e4e7798cda86a8e4c1f23e5d2b (diff)
downloadgcc-6b37bdaff18303bdc1042d9b99f11f83ac836c13.zip
gcc-6b37bdaff18303bdc1042d9b99f11f83ac836c13.tar.gz
gcc-6b37bdaff18303bdc1042d9b99f11f83ac836c13.tar.bz2
Fix new -Wparentheses warnings encountered during bootstrap
gcc/ChangeLog: PR c/70436 * gimplify.c (gimplify_omp_ordered): Add explicit braces to resolve a future -Wparentheses warning. * omp-low.c (scan_sharing_clauses): Likewise. * tree-parloops.c (eliminate_local_variables): Likewise. gcc/cp/ChangeLog: PR c/70436 * cp-tree.h (FOR_EACH_CLONE): Restructure macro to avoid potentially generating a future -Wparentheses warning in its callers. gcc/fortran/ChangeLog: PR c/70436 * openmp.c (gfc_find_omp_udr): Add explicit braces to resolve a future -Wparentheses warning. gcc/testsuite/ChangeLog: PR c/70436 * g++.dg/plugin/pragma_plugin.c (handle_pragma_sayhello): Add explicit braces to resolve a future -Wparentheses warning. From-SVN: r234801
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c108
1 files changed, 55 insertions, 53 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index f29d608..9c0119e 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -9878,64 +9878,66 @@ gimplify_omp_ordered (tree expr, gimple_seq body)
tree sink_c = NULL_TREE;
if (gimplify_omp_ctxp)
- for (c = OMP_ORDERED_CLAUSES (expr); c; c = OMP_CLAUSE_CHAIN (c))
- if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND
- && gimplify_omp_ctxp->loop_iter_var.is_empty ()
- && (OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SINK
- || OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SOURCE))
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "%<ordered%> construct with %<depend%> clause must be "
- "closely nested inside a loop with %<ordered%> clause "
- "with a parameter");
- failures++;
- }
- else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND
- && OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SINK)
- {
- bool fail = false;
- for (decls = OMP_CLAUSE_DECL (c), i = 0;
- decls && TREE_CODE (decls) == TREE_LIST;
- decls = TREE_CHAIN (decls), ++i)
- if (i >= gimplify_omp_ctxp->loop_iter_var.length () / 2)
- continue;
- else if (TREE_VALUE (decls)
- != gimplify_omp_ctxp->loop_iter_var[2 * i])
+ {
+ for (c = OMP_ORDERED_CLAUSES (expr); c; c = OMP_CLAUSE_CHAIN (c))
+ if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND
+ && gimplify_omp_ctxp->loop_iter_var.is_empty ()
+ && (OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SINK
+ || OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SOURCE))
+ {
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "%<ordered%> construct with %<depend%> clause must be "
+ "closely nested inside a loop with %<ordered%> clause "
+ "with a parameter");
+ failures++;
+ }
+ else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND
+ && OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SINK)
+ {
+ bool fail = false;
+ for (decls = OMP_CLAUSE_DECL (c), i = 0;
+ decls && TREE_CODE (decls) == TREE_LIST;
+ decls = TREE_CHAIN (decls), ++i)
+ if (i >= gimplify_omp_ctxp->loop_iter_var.length () / 2)
+ continue;
+ else if (TREE_VALUE (decls)
+ != gimplify_omp_ctxp->loop_iter_var[2 * i])
+ {
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "variable %qE is not an iteration "
+ "of outermost loop %d, expected %qE",
+ TREE_VALUE (decls), i + 1,
+ gimplify_omp_ctxp->loop_iter_var[2 * i]);
+ fail = true;
+ failures++;
+ }
+ else
+ TREE_VALUE (decls)
+ = gimplify_omp_ctxp->loop_iter_var[2 * i + 1];
+ if (!fail && i != gimplify_omp_ctxp->loop_iter_var.length () / 2)
+ {
+ error_at (OMP_CLAUSE_LOCATION (c),
+ "number of variables in %<depend(sink)%> "
+ "clause does not match number of "
+ "iteration variables");
+ failures++;
+ }
+ sink_c = c;
+ }
+ else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND
+ && OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SOURCE)
+ {
+ if (source_c)
{
error_at (OMP_CLAUSE_LOCATION (c),
- "variable %qE is not an iteration "
- "of outermost loop %d, expected %qE",
- TREE_VALUE (decls), i + 1,
- gimplify_omp_ctxp->loop_iter_var[2 * i]);
- fail = true;
+ "more than one %<depend(source)%> clause on an "
+ "%<ordered%> construct");
failures++;
}
else
- TREE_VALUE (decls)
- = gimplify_omp_ctxp->loop_iter_var[2 * i + 1];
- if (!fail && i != gimplify_omp_ctxp->loop_iter_var.length () / 2)
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "number of variables in %<depend(sink)%> "
- "clause does not match number of "
- "iteration variables");
- failures++;
- }
- sink_c = c;
- }
- else if (OMP_CLAUSE_CODE (c) == OMP_CLAUSE_DEPEND
- && OMP_CLAUSE_DEPEND_KIND (c) == OMP_CLAUSE_DEPEND_SOURCE)
- {
- if (source_c)
- {
- error_at (OMP_CLAUSE_LOCATION (c),
- "more than one %<depend(source)%> clause on an "
- "%<ordered%> construct");
- failures++;
- }
- else
- source_c = c;
- }
+ source_c = c;
+ }
+ }
if (source_c && sink_c)
{
error_at (OMP_CLAUSE_LOCATION (source_c),