aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-omp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-omp.cc')
-rw-r--r--gcc/c-family/c-omp.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/c-family/c-omp.cc b/gcc/c-family/c-omp.cc
index f5314d6..cd9d866 100644
--- a/gcc/c-family/c-omp.cc
+++ b/gcc/c-family/c-omp.cc
@@ -353,8 +353,13 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
}
bool save = in_late_binary_op;
in_late_binary_op = true;
- x = build_modify_expr (loc, blhs ? blhs : lhs, NULL_TREE, opcode,
- loc, rhs, NULL_TREE);
+ if ((opcode == MIN_EXPR || opcode == MAX_EXPR)
+ && build_binary_op (loc, LT_EXPR, blhs ? blhs : lhs, rhs,
+ true) == error_mark_node)
+ x = error_mark_node;
+ else
+ x = build_modify_expr (loc, blhs ? blhs : lhs, NULL_TREE, opcode,
+ loc, rhs, NULL_TREE);
in_late_binary_op = save;
if (x == error_mark_node)
return error_mark_node;