From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7856) id 47370385801E; Sat, 31 Jul 2021 10:24:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47370385801E MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Xi Ruoyao To: gcc-cvs@gcc.gnu.org Subject: [gcc r9-9655] mips: Fix up mips_atomic_assign_expand_fenv [PR94780] X-Act-Checkin: gcc X-Git-Author: Xi Ruoyao X-Git-Refname: refs/heads/releases/gcc-9 X-Git-Oldrev: 49a2cbb3f5906ac20d7a4619d5d3112584d46cf7 X-Git-Newrev: 79184d8c57d377a242610543a2cbe4f154924be7 Message-Id: <20210731102423.47370385801E@sourceware.org> Date: Sat, 31 Jul 2021 10:24:23 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 31 Jul 2021 10:24:23 -0000 https://gcc.gnu.org/g:79184d8c57d377a242610543a2cbe4f154924be7 commit r9-9655-g79184d8c57d377a242610543a2cbe4f154924be7 Author: Xi Ruoyao Date: Fri Jul 30 23:44:14 2021 +0800 mips: Fix up mips_atomic_assign_expand_fenv [PR94780] Commit message shamelessly copied from 1777beb6b129 by jakub: This function, because it is sometimes called even outside of function bodies, uses create_tmp_var_raw rather than create_tmp_var. But in order for that to work, when first referenced, the VAR_DECLs need to appear in a TARGET_EXPR so that during gimplification the var gets the right DECL_CONTEXT and is added to local decls. gcc/ PR target/94780 * config/mips/mips.c (mips_atomic_assign_expand_fenv): Use TARGET_EXPR instead of MODIFY_EXPR. (cherry picked from commit 2065654435e3d97676366f82b939bc9273382dbe) Diff: --- gcc/config/mips/mips.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index d758fbf1be6..1e3ea6b5f43 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -22370,12 +22370,12 @@ mips_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update) tree get_fcsr = mips_builtin_decls[MIPS_GET_FCSR]; tree set_fcsr = mips_builtin_decls[MIPS_SET_FCSR]; tree get_fcsr_hold_call = build_call_expr (get_fcsr, 0); - tree hold_assign_orig = build2 (MODIFY_EXPR, MIPS_ATYPE_USI, - fcsr_orig_var, get_fcsr_hold_call); + tree hold_assign_orig = build4 (TARGET_EXPR, MIPS_ATYPE_USI, + fcsr_orig_var, get_fcsr_hold_call, NULL, NULL); tree hold_mod_val = build2 (BIT_AND_EXPR, MIPS_ATYPE_USI, fcsr_orig_var, build_int_cst (MIPS_ATYPE_USI, 0xfffff003)); - tree hold_assign_mod = build2 (MODIFY_EXPR, MIPS_ATYPE_USI, - fcsr_mod_var, hold_mod_val); + tree hold_assign_mod = build4 (TARGET_EXPR, MIPS_ATYPE_USI, + fcsr_mod_var, hold_mod_val, NULL, NULL); tree set_fcsr_hold_call = build_call_expr (set_fcsr, 1, fcsr_mod_var); tree hold_all = build2 (COMPOUND_EXPR, MIPS_ATYPE_USI, hold_assign_orig, hold_assign_mod); @@ -22385,8 +22385,8 @@ mips_atomic_assign_expand_fenv (tree *hold, tree *clear, tree *update) *clear = build_call_expr (set_fcsr, 1, fcsr_mod_var); tree get_fcsr_update_call = build_call_expr (get_fcsr, 0); - *update = build2 (MODIFY_EXPR, MIPS_ATYPE_USI, - exceptions_var, get_fcsr_update_call); + *update = build4 (TARGET_EXPR, MIPS_ATYPE_USI, + exceptions_var, get_fcsr_update_call, NULL, NULL); tree set_fcsr_update_call = build_call_expr (set_fcsr, 1, fcsr_orig_var); *update = build2 (COMPOUND_EXPR, void_type_node, *update, set_fcsr_update_call);