From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 88687 invoked by alias); 26 Feb 2016 15:51:38 -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 88671 invoked by uid 89); 26 Feb 2016 15:51:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_20,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=resetting, UD:pr69245_1.c, sk:TREE_TA, optab X-HELO: cam-smtp0.cambridge.arm.com Received: from fw-tnat.cambridge.arm.com (HELO cam-smtp0.cambridge.arm.com) (217.140.96.140) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 26 Feb 2016 15:51:36 +0000 Received: from arm.com (e107456-lin.cambridge.arm.com [10.2.206.78]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with ESMTP id u1QFpWXd013910; Fri, 26 Feb 2016 15:51:32 GMT Date: Fri, 26 Feb 2016 15:51:00 -0000 From: James Greenhalgh To: Kyrill Tkachov Cc: GCC Patches , Marcus Shawcroft , Richard Earnshaw Subject: Re: [PATCH][AArch64] Set TREE_TARGET_GLOBALS in aarch64_set_current_function when new tree is the default node to recalculate optab availability Message-ID: <20160226155131.GE40219@arm.com> References: <56CEDFB5.8050707@foss.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56CEDFB5.8050707@foss.arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg01806.txt.bz2 On Thu, Feb 25, 2016 at 11:04:21AM +0000, Kyrill Tkachov wrote: > Hi all, > > Seems like aarch64 is suffering from something similar to PR 69245 as well. > If a target pragma sets the target state to the same as the > target_option_default_node the node is just a pointer to > target_option_default_node rather than a distinct identical node. So we must > still restore the target globals even when setting to > target_option_default_node in order to force the midend to recompute the > availability of various optabs. > > If we don't do it, we can get in a problem like in the testcase where the > isa_flags are all set correctly, but the optab HAVE_* predicates have not > been recomputed. > > There is also a related issue present when popping/resetting target pragmas > for which I'll send out a patch separately. > > Bootstrapped and tested on aarch64. > > Ok for trunk? OK. Thanks, James > Thanks, > Kyrill > > > 2016-02-25 Kyrylo Tkachov > > PR target/69245 > * config/aarch64/aarch64.c (aarch64_set_current_function): Save/restore > target globals when switching to target_option_default_node. > > 2016-02-25 Kyrylo Tkachov > > PR target/69245 > * gcc.target/aarch64/pr69245_1.c: New test.