From b4ace720e004f736f1ee46b374c12f9826aad630 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 6 May 2020 09:40:33 +0200 Subject: [PATCH] riscv: Fix up riscv_atomic_assign_expand_fenv [PR94950] 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 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/ChangeLog | 4 ++++ gcc/config/riscv/riscv-builtins.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8040d0d59af..7a691f28499 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2020-05-06 Jakub Jelinek + 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. diff --git a/gcc/config/riscv/riscv-builtins.c b/gcc/config/riscv/riscv-builtins.c index 201fdb52f20..a45108e0355 100644 --- a/gcc/config/riscv/riscv-builtins.c +++ b/gcc/config/riscv/riscv-builtins.c @@ -283,8 +283,8 @@ riscv_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update) 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; } -- 2.30.2