From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 67019 invoked by alias); 9 Jun 2017 09:54:36 -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 66990 invoked by uid 89); 9 Jun 2017 09:54:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 09 Jun 2017 09:54:33 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 4B634548010; Fri, 9 Jun 2017 11:54:35 +0200 (CEST) Date: Fri, 09 Jun 2017 09:54:00 -0000 From: Jan Hubicka To: Christophe Lyon Cc: "gcc-patches@gcc.gnu.org" Subject: Re: Statically propagate basic blocks which are likely executed 0 times Message-ID: <20170609095435.GD6887@kam.mff.cuni.cz> References: <20170608125249.GB65161@kam.mff.cuni.cz> <4E3B1900-B7BF-4332-B6E4-25FA4BEC81B8@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2017-06/txt/msg00588.txt.bz2 > Since this commit (r249013), I've noticed a regression on arm targets: > FAIL: gcc.target/arm/cold-lc.c scan-assembler-not bl[^\n]*dump_stack I think that is because we optimize the testcase: /* { dg-do compile } */ /* { dg-options "-O2 -mlong-calls" } */ /* { dg-final { scan-assembler-not "bl\[^\n\]*dump_stack" } } */ extern void dump_stack (void) __attribute__ ((__cold__)) __attribute__ ((noinline)); struct thread_info { struct task_struct *task; }; extern struct thread_info *current_thread_info (void); extern int show_stack (struct task_struct *, unsigned long *); void dump_stack (void) { unsigned long stack; show_stack ((current_thread_info ()->task), &stack); } void die (char *str, void *fp, int nr) { dump_stack (); while (1); } the new logic will move die() into cold section (because it unavoidably leads to cold code and thus allow using the bl instruction. I guess just modifying die to call dump_stack conditionally should fix the testcase. Honza > > > >>+ if (!n->analyzed > >>+ || n->decl == current_function_decl) > >>+ return false; > >>+ return n->frequency == NODE_FREQUENCY_UNLIKELY_EXECUTED; > >>+} > >