aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/c-parser.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/gcc/c/c-parser.cc b/gcc/c/c-parser.cc
index 62c6bc0..7672e06 100644
--- a/gcc/c/c-parser.cc
+++ b/gcc/c/c-parser.cc
@@ -22884,9 +22884,16 @@ c_parser_omp_atomic (location_t loc, c_parser *parser, bool openacc)
goto saw_error;
if (code == NOP_EXPR)
{
- lhs = c_parser_expression (parser).value;
- lhs = c_fully_fold (lhs, false, NULL);
- if (lhs == error_mark_node)
+ eloc = c_parser_peek_token (parser)->location;
+ expr = c_parser_expression (parser);
+ expr = default_function_array_read_conversion (eloc, expr);
+ /* atomic write is represented by OMP_ATOMIC with NOP_EXPR
+ opcode. */
+ code = OMP_ATOMIC;
+ lhs = v;
+ v = NULL_TREE;
+ rhs = c_fully_fold (expr.value, false, NULL);
+ if (rhs == error_mark_node)
goto saw_error;
}
else
@@ -22899,15 +22906,6 @@ c_parser_omp_atomic (location_t loc, c_parser *parser, bool openacc)
if (non_lvalue_p)
lhs = non_lvalue (lhs);
}
- if (code == NOP_EXPR)
- {
- /* atomic write is represented by OMP_ATOMIC with NOP_EXPR
- opcode. */
- code = OMP_ATOMIC;
- rhs = lhs;
- lhs = v;
- v = NULL_TREE;
- }
goto done;
case OMP_ATOMIC_CAPTURE_NEW:
if (c_parser_next_token_is (parser, CPP_OPEN_BRACE))