From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17937 invoked by alias); 7 Jan 2011 12:47:21 -0000 Received: (qmail 17927 invoked by uid 22791); 7 Jan 2011 12:47:21 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from ksp.mff.cuni.cz (HELO atrey.karlin.mff.cuni.cz) (195.113.26.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 07 Jan 2011 12:47:17 +0000 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 4018) id 28D04F033E; Fri, 7 Jan 2011 13:47:15 +0100 (CET) Date: Fri, 07 Jan 2011 12:48:00 -0000 From: Jan Hubicka To: "d.g.gorbachev at gmail dot com" Cc: gcc-bugs@gcc.gnu.org Subject: Re: [Bug lto/47205] New: GCC emits optimized out noinline function Message-ID: <20110107124715.GI20917@atrey.karlin.mff.cuni.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00589.txt.bz2 > extern int foo(void); > > int main(void) > { > return foo() * 0; > } This is because gimple part of optimizers for some reason leads to the following in the optimized dump: main () { : foo (); return 0; } and only RTL optimizers do the trick. This is weird since pure/const detect function as pure (seen in pure-const dump) Read info for foo/2 const nothrow pure const state: const previously known state: const but tree-ssa-dce apparently fails to remove the statement. I guess it is confused by lack of return value. I will take a look. But this is tree-optimization bug. Honza