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.
2020-05-06 Jakub Jelinek <jakub@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.
2020-05-06 Jakub Jelinek <jakub@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.
+
PR rtl-optimization/94873
* combine.c (combine_instructions): Don't optimize using REG_EQUAL
note if SET_SRC (set) has side-effects.
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;
}