public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/redhat/heads/gcc-8-branch)] s390: Fix up s390_atomic_assign_expand_fenv
@ 2021-04-23 10:15 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2021-04-23 10:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6702f968d7eff04945c0d8535156a0b9883b88c3

commit 6702f968d7eff04945c0d8535156a0b9883b88c3
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Oct 1 11:04:56 2020 +0200

    s390: Fix up s390_atomic_assign_expand_fenv
    
    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).
    
    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.
    
    (cherry picked from commit 85516b71730d8f9401c34407ac3fadf5f1ebfc4e)

Diff:
---
 gcc/config/s390/s390.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 9057154be07..20424537558 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -16225,12 +16225,13 @@ s390_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
 
      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);
 
@@ -16249,8 +16250,8 @@ s390_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
   __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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-23 10:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 10:15 [gcc(refs/vendors/redhat/heads/gcc-8-branch)] s390: Fix up s390_atomic_assign_expand_fenv Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).