From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mengyan1223.wang (mengyan1223.wang [89.208.246.23]) by sourceware.org (Postfix) with ESMTPS id AEADC39AD81E; Fri, 23 Jul 2021 12:47:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AEADC39AD81E Received: from [192.168.124.4] (unknown [113.200.174.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384)) (Client did not present a certificate) (Authenticated sender: xry111@mengyan1223.wang) by mengyan1223.wang (Postfix) with ESMTPSA id 1DDDF65F0B; Fri, 23 Jul 2021 08:47:52 -0400 (EDT) Message-ID: <7509c909329342c63565348630e761a46e0c3b66.camel@mengyan1223.wang> Subject: PING^4: [PATCH] mips: Fix up mips_atomic_assign_expand_fenv [PR94780] From: Xi Ruoyao Reply-To: xry111@mengyan1223.wang To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek , Matthew Fortune , "Maciej W. Rozycki" , Richard Sandiford , xry111@mengyan1223.wang Date: Fri, 23 Jul 2021 20:47:51 +0800 In-Reply-To: <84b8b6a1019dd2a6eb84daf6cc21358d8781f5b7.camel@mengyan1223.wang> References: <84b8b6a1019dd2a6eb84daf6cc21358d8781f5b7.camel@mengyan1223.wang> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3037.9 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2021 12:47:57 -0000 Ping again. On Wed, 2021-06-23 at 11:11 +0800, Xi Ruoyao wrote: > 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. > > Bootstrapped & regtested on mips64el-linux-gnu.  Ok for trunk and backport > to 11, 10, and 9? > > gcc/ > >         * config/mips/mips.c (mips_atomic_assign_expand_fenv): Use >           TARGET_EXPR instead of MODIFY_EXPR. > --- >  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 8f043399a8e..89d1be6cea6 100644 > --- a/gcc/config/mips/mips.c > +++ b/gcc/config/mips/mips.c > @@ -22439,12 +22439,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); > @@ -22454,8 +22454,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); -- Xi Ruoyao School of Aerospace Science and Technology, Xidian University