From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16843 invoked by alias); 9 Jul 2015 13:21:42 -0000 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 Received: (qmail 15270 invoked by uid 48); 9 Jul 2015 13:21:39 -0000 From: "aldot at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/65534] tailcall not optimized away Date: Thu, 09 Jul 2015 13:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: aldot at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 6.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg00773.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65534 --- Comment #2 from Bernhard Reutner-Fischer --- (In reply to Jan Hubicka from comment #1) > > #ifndef OPTIMIZE_MANUALLY > > void setutent(void) { > > ((void)0); > > __setutent_unlocked(); > > ((void)0); > > } > > #else > > extern __typeof (__setutent_unlocked) setutent > > __attribute__ ((alias ("__setutent_unlocked"))); > > #endif > > I do not think GCC can safely optimize this, becuase in the first > case &setutent != &__setutent_unlocked, wile in the optimized > case the addresses are equal. Note that __setutent_unlocked is static, so i don't see how this specific case would prevent optimization?