From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20530 invoked by alias); 22 Nov 2010 11:09:09 -0000 Received: (qmail 20519 invoked by uid 22791); 22 Nov 2010 11:09:08 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 22 Nov 2010 11:09:04 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/46596] misbehavior when mixing always_inline and alias attributes in the same compilation unit X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Last reconfirmed CC Ever Confirmed Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Mon, 22 Nov 2010 11:11:00 -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 X-SW-Source: 2010-11/txt/msg02710.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46596 Richard Guenther changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2010.11.22 11:08:59 CC| |hubicka at gcc dot gnu.org Ever Confirmed|0 |1 --- Comment #2 from Richard Guenther 2010-11-22 11:08:59 UTC --- Confirmed. That -Winline changes behavior is definitely a bug. I'm not so sure about the rest, what probably happens is that the later extern declaration overrides the former (but inherits the always-inline attribute), removing the body. What you seem to want is always inline foo(), but still have an out-of-line copy that dispatches to __foo. That seems - backward, no? Complete testcase: extern void __in(int i); extern inline __attribute__((always_inline,gnu_inline)) void foo(int i) { __in(i); } void bar(int i) { foo(i + 1234); } void __foo(int i) { } extern void foo(int i) __attribute__((alias("__foo"))); > ./cc1 -quiet /tmp/t.c -O -Winline /tmp/t.c: In function 'bar': /tmp/t.c:6:13: sorry, unimplemented: inlining failed in call to 'foo': function body not available /tmp/t.c:4:22: sorry, unimplemented: called from here expected: bar calls __in (i + 1234).