Hi!

Similarly to the fixes on many other targets, riscv needs to use TARGET_EXPR
to avoid having the create_tmp_var_raw temporaries without proper DECL_CONTEXT
and not mentioned in local decls.

Committed as obvious to trunk.

2020-05-06  Jakub Jelinek  <ja...@redhat.com>

        PR target/94950
        * config/riscv/riscv-builtins.c (riscv_atomic_assign_expand_fenv): Use
        TARGET_EXPR instead of MODIFY_EXPR for first assignment to old_flags.

--- gcc/config/riscv/riscv-builtins.c.jj        2020-01-12 11:54:36.384413846 
+0100
+++ gcc/config/riscv/riscv-builtins.c   2020-05-05 12:41:08.005288721 +0200
@@ -283,8 +283,8 @@ riscv_atomic_assign_expand_fenv (tree *h
   tree fsflags = GET_BUILTIN_DECL (CODE_FOR_riscv_fsflags);
   tree old_flags = create_tmp_var_raw (RISCV_ATYPE_USI);
 
-  *hold = build2 (MODIFY_EXPR, RISCV_ATYPE_USI, old_flags,
-                 build_call_expr (frflags, 0));
+  *hold = build4 (TARGET_EXPR, RISCV_ATYPE_USI, old_flags,
+                 build_call_expr (frflags, 0), NULL_TREE, NULL_TREE);
   *clear = build_call_expr (fsflags, 1, old_flags);
   *update = NULL_TREE;
 }

        Jakub

Reply via email to