From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23092 invoked by alias); 6 Oct 2015 09:15:33 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 23074 invoked by uid 89); 6 Oct 2015 09:15:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 3 recipients X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 06 Oct 2015 09:15:29 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 8F3BE2F9EA1C; Tue, 6 Oct 2015 11:15:26 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TWVEqWmYZ2jp; Tue, 6 Oct 2015 11:15:26 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id E86D02F9EA19; Tue, 6 Oct 2015 11:15:25 +0200 (CEST) From: Eric Botcazou To: Marek Polacek Cc: gcc-patches@gcc.gnu.org, Joseph Myers , clm@codesourcery.com, matthew.fortune@imgtec.com, dje.gcc@gmail.com, Richard Henderson , Uros Bizjak , davem@redhat.com, uweigand@de.ibm.com, Andreas.Krebbel@de.ibm.com, richard.earnshaw@arm.com, ramana.radhakrishnan@arm.com, nickc@redhat.com, olegendo@gcc.gnu.org, kkojima@gcc.gnu.org, marcus.shawcroft@arm.com Subject: Re: C PATCH for c/65345 (file-scope _Atomic expansion with floats) Date: Tue, 06 Oct 2015 09:15:00 -0000 Message-ID: <1920101.ITbu3dyhTe@polaris> User-Agent: KMail/4.14.9 (Linux/3.16.7-24-desktop; KDE/4.14.9; x86_64; ; ) In-Reply-To: <20151001144941.GT6184@redhat.com> References: <20151001144941.GT6184@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="nextPart3197237.BBNN1uRnPM" Content-Transfer-Encoding: 7Bit X-SW-Source: 2015-10/txt/msg00514.txt.bz2 This is a multi-part message in MIME format. --nextPart3197237.BBNN1uRnPM Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Content-length: 1033 > Joseph reminded me that I had forgotten about this patch. As mentioned > here , I'm > removing the XFAILs in the tests so people are likely to see new FAILs. > > I think the following targets will need similar fix as the one below: > * MIPS > * rs6000 > * alpha > * sparc > * s390 > * arm > * sh > * aarch64 > > I'm CCing the respective maintainers. You might want to XFAIL those tests. Thanks, here are the SPARC bits with an explanation for the other maintainers: create_tmp_var_raw must be used instead of create_tmp_var because the hook can be invoked outside of a function context; likewise for TREE_ADDRESSABLE vs mark_addressable; TARGET_EXPR is needed for variables that are addressable (because their address is taken) to force proper gimplification. Tested on SPARC/Solaris, applied on the mainline. PR c/65345 * config/sparc/sparc.c (sparc_atomic_assign_expand_fenv): Adjust to use create_tmp_var_raw rather than create_tmp_var. -- Eric Botcazou --nextPart3197237.BBNN1uRnPM Content-Disposition: attachment; filename="pr65345.diff" Content-Transfer-Encoding: 7Bit Content-Type: text/x-patch; charset="UTF-8"; name="pr65345.diff" Content-length: 2179 Index: config/sparc/sparc.c =================================================================== --- config/sparc/sparc.c (revision 228512) +++ config/sparc/sparc.c (working copy) @@ -12540,20 +12540,23 @@ sparc_atomic_assign_expand_fenv (tree *h __builtin_load_fsr (&tmp1_var); */ - tree fenv_var = create_tmp_var (unsigned_type_node); - mark_addressable (fenv_var); + tree fenv_var = create_tmp_var_raw (unsigned_type_node); + TREE_ADDRESSABLE (fenv_var) = 1; tree fenv_addr = build_fold_addr_expr (fenv_var); tree stfsr = sparc_builtins[SPARC_BUILTIN_STFSR]; - tree hold_stfsr = build_call_expr (stfsr, 1, fenv_addr); + tree hold_stfsr + = build4 (TARGET_EXPR, unsigned_type_node, fenv_var, + build_call_expr (stfsr, 1, fenv_addr), NULL_TREE, NULL_TREE); - tree tmp1_var = create_tmp_var (unsigned_type_node); - mark_addressable (tmp1_var); + tree tmp1_var = create_tmp_var_raw (unsigned_type_node); + TREE_ADDRESSABLE (tmp1_var) = 1; tree masked_fenv_var = build2 (BIT_AND_EXPR, unsigned_type_node, fenv_var, build_int_cst (unsigned_type_node, ~(accrued_exception_mask | trap_enable_mask))); tree hold_mask - = build2 (MODIFY_EXPR, void_type_node, tmp1_var, masked_fenv_var); + = build4 (TARGET_EXPR, unsigned_type_node, tmp1_var, masked_fenv_var, + NULL_TREE, NULL_TREE); tree tmp1_addr = build_fold_addr_expr (tmp1_var); tree ldfsr = sparc_builtins[SPARC_BUILTIN_LDFSR]; @@ -12578,10 +12581,12 @@ sparc_atomic_assign_expand_fenv (tree *h tmp2_var >>= 5; __atomic_feraiseexcept ((int) tmp2_var); */ - tree tmp2_var = create_tmp_var (unsigned_type_node); - mark_addressable (tmp2_var); - tree tmp3_addr = build_fold_addr_expr (tmp2_var); - tree update_stfsr = build_call_expr (stfsr, 1, tmp3_addr); + tree tmp2_var = create_tmp_var_raw (unsigned_type_node); + TREE_ADDRESSABLE (tmp2_var) = 1; + tree tmp2_addr = build_fold_addr_expr (tmp2_var); + tree update_stfsr + = build4 (TARGET_EXPR, unsigned_type_node, tmp2_var, + build_call_expr (stfsr, 1, tmp2_addr), NULL_TREE, NULL_TREE); tree update_ldfsr = build_call_expr (ldfsr, 1, fenv_addr); --nextPart3197237.BBNN1uRnPM--