arm: Extend the PR94780 fix to arm
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 29 Apr 2020 10:51:38 +0000 (11:51 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 29 Apr 2020 10:51:38 +0000 (11:51 +0100)
Essentially the same fix as for x86.

2020-04-29  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/arm/arm-builtins.c (arm_atomic_assign_expand_fenv): Use
TARGET_EXPR instead of MODIFY_EXPR for the first assignments to
fenv_var and new_fenv_var.

gcc/ChangeLog
gcc/config/arm/arm-builtins.c

index 7a04f1f4191925497c8acf3d84acd7f37bf70c3f..2de5b3c81b424efeab1a9628f7ba3291e95a007a 100644 (file)
@@ -1,3 +1,9 @@
+2020-04-29  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * config/arm/arm-builtins.c (arm_atomic_assign_expand_fenv): Use
+       TARGET_EXPR instead of MODIFY_EXPR for the first assignments to
+       fenv_var and new_fenv_var.
+
 2020-04-29  Richard Sandiford  <richard.sandiford@arm.com>
 
        * doc/sourcebuild.texi (arm_arch_v8a_hard_ok): Document new
index aee3fd6e2ff452cc7d068caef2ee943c34c91788..f64742e644774a11cb8717a7827c5056b991640e 100644 (file)
@@ -4167,8 +4167,9 @@ arm_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
   mask = build_int_cst (unsigned_type_node,
                        ~((ARM_FE_ALL_EXCEPT << ARM_FE_EXCEPT_SHIFT)
                          | ARM_FE_ALL_EXCEPT));
-  ld_fenv = build2 (MODIFY_EXPR, unsigned_type_node,
-                   fenv_var, build_call_expr (get_fpscr, 0));
+  ld_fenv = build4 (TARGET_EXPR, unsigned_type_node,
+                   fenv_var, build_call_expr (get_fpscr, 0),
+                   NULL_TREE, NULL_TREE);
   masked_fenv = build2 (BIT_AND_EXPR, unsigned_type_node, fenv_var, mask);
   hold_fnclex = build_call_expr (set_fpscr, 1, masked_fenv);
   *hold = build2 (COMPOUND_EXPR, void_type_node,
@@ -4189,8 +4190,8 @@ arm_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
        __atomic_feraiseexcept (new_fenv_var);  */
 
   new_fenv_var = create_tmp_var_raw (unsigned_type_node);
-  reload_fenv = build2 (MODIFY_EXPR, unsigned_type_node, new_fenv_var,
-                       build_call_expr (get_fpscr, 0));
+  reload_fenv = build4 (TARGET_EXPR, unsigned_type_node, new_fenv_var,
+                       build_call_expr (get_fpscr, 0), NULL_TREE, NULL_TREE);
   restore_fnenv = build_call_expr (set_fpscr, 1, fenv_var);
   atomic_feraiseexcept = builtin_decl_implicit (BUILT_IN_ATOMIC_FERAISEEXCEPT);
   update_call = build_call_expr (atomic_feraiseexcept, 1,