[committed] s390: Fix up s390_atomic_assign_expand_fenv
Jakub Jelinek
jakub@redhat.com
Thu Oct 1 09:13:48 GMT 2020
Hi!
The following patch fixes
-FAIL: gcc.dg/pr94780.c (internal compiler error)
-FAIL: gcc.dg/pr94780.c (test for excess errors)
-FAIL: gcc.dg/pr94842.c (internal compiler error)
-FAIL: gcc.dg/pr94842.c (test for excess errors)
on s390x-linux. The fix is essentially the same as has been applied to many
other targets (i386, aarch64, arm, rs6000, alpha, riscv).
Bootstrapped/regtested on s390x-linux, committed to trunk and release
branches as obvious.
2020-10-01 Jakub Jelinek <jakub@redhat.com>
* config/s390/s390.c (s390_atomic_assign_expand_fenv): Use
TARGET_EXPR instead of MODIFY_EXPR for the first assignments to
fenv_var and old_fpc. Formatting fixes.
--- gcc/config/s390/s390.c.jj 2020-09-14 09:04:36.086851054 +0200
+++ gcc/config/s390/s390.c 2020-09-30 10:22:50.579603271 +0200
@@ -16082,12 +16082,13 @@ s390_atomic_assign_expand_fenv (tree *ho
fenv_var = __builtin_s390_efpc ();
__builtin_s390_sfpc (fenv_var & mask) */
- tree old_fpc = build2 (MODIFY_EXPR, unsigned_type_node, fenv_var, call_efpc);
- tree new_fpc =
- build2 (BIT_AND_EXPR, unsigned_type_node, fenv_var,
- build_int_cst (unsigned_type_node,
- ~(FPC_DXC_MASK | FPC_FLAGS_MASK |
- FPC_EXCEPTION_MASK)));
+ tree old_fpc = build4 (TARGET_EXPR, unsigned_type_node, fenv_var, call_efpc,
+ NULL_TREE, NULL_TREE);
+ tree new_fpc
+ = build2 (BIT_AND_EXPR, unsigned_type_node, fenv_var,
+ build_int_cst (unsigned_type_node,
+ ~(FPC_DXC_MASK | FPC_FLAGS_MASK
+ | FPC_EXCEPTION_MASK)));
tree set_new_fpc = build_call_expr (sfpc, 1, new_fpc);
*hold = build2 (COMPOUND_EXPR, void_type_node, old_fpc, set_new_fpc);
@@ -16106,8 +16107,8 @@ s390_atomic_assign_expand_fenv (tree *ho
__atomic_feraiseexcept ((old_fpc & FPC_FLAGS_MASK) >> FPC_FLAGS_SHIFT); */
old_fpc = create_tmp_var_raw (unsigned_type_node);
- tree store_old_fpc = build2 (MODIFY_EXPR, void_type_node,
- old_fpc, call_efpc);
+ tree store_old_fpc = build4 (TARGET_EXPR, void_type_node, old_fpc, call_efpc,
+ NULL_TREE, NULL_TREE);
set_new_fpc = build_call_expr (sfpc, 1, fenv_var);
Jakub
More information about the Gcc-patches
mailing list