aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-omp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-omp.c')
-rw-r--r--gcc/c-family/c-omp.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c
index 75184a3..476abc1 100644
--- a/gcc/c-family/c-omp.c
+++ b/gcc/c-family/c-omp.c
@@ -376,7 +376,7 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
return error_mark_node;
gcc_assert (TREE_CODE (rhs1) == EQ_EXPR);
tree cmptype = TREE_TYPE (TREE_OPERAND (rhs1, 0));
- if (SCALAR_FLOAT_TYPE_P (cmptype))
+ if (SCALAR_FLOAT_TYPE_P (cmptype) && !test)
{
bool clear_padding = false;
if (BITS_PER_UNIT == 8 && CHAR_BIT == 8)
@@ -443,12 +443,14 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
}
}
}
- if (r)
+ if (r && test)
+ rtmp = rhs1;
+ else if (r)
{
- tree var = create_tmp_var (boolean_type_node);
+ tree var = create_tmp_var_raw (boolean_type_node);
DECL_CONTEXT (var) = current_function_decl;
rtmp = build4 (TARGET_EXPR, boolean_type_node, var,
- NULL, NULL, NULL);
+ boolean_false_node, NULL, NULL);
save = in_late_binary_op;
in_late_binary_op = true;
x = build_modify_expr (loc, var, NULL_TREE, NOP_EXPR,
@@ -529,14 +531,11 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
}
}
if (blhs)
+ x = build3_loc (loc, BIT_FIELD_REF, TREE_TYPE (blhs), x,
+ bitsize_int (bitsize), bitsize_int (bitpos));
+ if (r && !test)
{
- x = build3_loc (loc, BIT_FIELD_REF, TREE_TYPE (blhs), x,
- bitsize_int (bitsize), bitsize_int (bitpos));
- type = TREE_TYPE (blhs);
- }
- if (r)
- {
- vtmp = create_tmp_var (TREE_TYPE (x));
+ vtmp = create_tmp_var_raw (TREE_TYPE (x));
DECL_CONTEXT (vtmp) = current_function_decl;
}
else
@@ -545,10 +544,11 @@ c_finish_omp_atomic (location_t loc, enum tree_code code,
loc, x, NULL_TREE);
if (x == error_mark_node)
return error_mark_node;
- if (r)
+ type = TREE_TYPE (x);
+ if (r && !test)
{
- vtmp = build4 (TARGET_EXPR, boolean_type_node, vtmp,
- NULL, NULL, NULL);
+ vtmp = build4 (TARGET_EXPR, TREE_TYPE (vtmp), vtmp,
+ build_zero_cst (TREE_TYPE (vtmp)), NULL, NULL);
gcc_assert (TREE_CODE (x) == MODIFY_EXPR
&& TREE_OPERAND (x, 0) == TARGET_EXPR_SLOT (vtmp));
TREE_OPERAND (x, 0) = vtmp;