Fix PR65345 in SH backend
authorKaz Kojima <kkojima@gcc.gnu.org>
Mon, 5 Oct 2015 22:18:05 +0000 (22:18 +0000)
committerKaz Kojima <kkojima@gcc.gnu.org>
Mon, 5 Oct 2015 22:18:05 +0000 (22:18 +0000)
Adjust to use create_tmp_var_raw rather than create_tmp_var at
sh_atomic_assign_expand_fenv.

From-SVN: r228502

gcc/ChangeLog
gcc/config/sh/sh.c

index d63f321612d7da7c92df21ca313ee8c20f820cbb..1007bd9a333fdda00ade9b656e25b839f0e84766 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-05  Kaz Kojima  <kkojima@gcc.gnu.org>
+
+       PR c/65345
+       * config/sh/sh.c (sh_atomic_assign_expand_fenv): Adjust to use
+       create_tmp_var_raw rather than create_tmp_var.
+
 2015-10-05  Marek Polacek  <polacek@redhat.com>
 
        * tree-ssa-loop-im.c
index 92e9f9f902c8b1e55ff8d0727eeafc5bde0c6302..54da3386ff733ce1bc07ebcecf9e4aaf87d620c6 100644 (file)
@@ -12106,7 +12106,7 @@ sh_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
 
        __builtin_sh_set_fpscr (masked_fenv);  */
 
-  fenv_var = create_tmp_var (unsigned_type_node);
+  fenv_var = create_tmp_var_raw (unsigned_type_node);
   mask = build_int_cst (unsigned_type_node,
                        ~((SH_FE_ALL_EXCEPT << SH_FE_EXCEPT_SHIFT)
                          | SH_FE_ALL_EXCEPT));
@@ -12114,9 +12114,11 @@ sh_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
                    fenv_var, build_call_expr (sh_builtin_get_fpscr, 0));
   masked_fenv = build2 (BIT_AND_EXPR, unsigned_type_node, fenv_var, mask);
   hold_fnclex = build_call_expr (sh_builtin_set_fpscr, 1, masked_fenv);
-  *hold = build2 (COMPOUND_EXPR, void_type_node,
-                 build2 (COMPOUND_EXPR, void_type_node, masked_fenv, ld_fenv),
-                 hold_fnclex);
+  fenv_var = build4 (TARGET_EXPR, unsigned_type_node, fenv_var,
+                    build2 (COMPOUND_EXPR, void_type_node, masked_fenv,
+                            ld_fenv),
+                    NULL_TREE, NULL_TREE);
+  *hold = build2 (COMPOUND_EXPR, void_type_node, fenv_var, hold_fnclex);
 
   /* Store the value of masked_fenv to clear the exceptions:
      __builtin_sh_set_fpscr (masked_fenv);  */
@@ -12131,7 +12133,7 @@ sh_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update)
 
        __atomic_feraiseexcept (new_fenv_var);  */
 
-  new_fenv_var = create_tmp_var (unsigned_type_node);
+  new_fenv_var = create_tmp_var_raw (unsigned_type_node);
   reload_fenv = build2 (MODIFY_EXPR, unsigned_type_node, new_fenv_var,
                        build_call_expr (sh_builtin_get_fpscr, 0));
   restore_fnenv = build_call_expr (sh_builtin_set_fpscr, 1, fenv_var);