From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4308 invoked by alias); 25 Aug 2015 11:26:07 -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 4106 invoked by uid 48); 25 Aug 2015 11:26:01 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/10837] noreturn attribute causes no sibling calling optimization Date: Tue, 25 Aug 2015 11:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 3.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 3.4.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-08/txt/msg01754.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10837 --- Comment #12 from H.J. Lu --- (In reply to Richard Henderson from comment #2) > Working as designed. > (1) It often takes more insns to pop the stack frame than to make the call. > (2) You get a proper backtrace from abort. > (3) http://gcc.gnu.org/ml/gcc-patches/2000-10/msg00180.html Glibc has been using ENTRY (__memmove_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) jb __chk_fail jmp memmove END (__memmove_chk) since 2004. #1 and #2 shouldn't be the reason not to optimize. I am using: /* Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10837 noreturn attribute disable tail call optimization. Removes noreturn attribute to enable tail call optimization. */ extern void *chk_fail (void) __asm__ ("__chk_fail") attribute_hidden; to work around this.