From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18337 invoked by alias); 24 May 2011 12:51:26 -0000 Received: (qmail 18021 invoked by uid 22791); 24 May 2011 12:51:24 -0000 X-SWARE-Spam-Status: No, hits=-2.7 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; Tue, 24 May 2011 12:51:11 +0000 From: "chrbr at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug regression/49139] New: always_inline attribute inconsistencies X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: regression X-Bugzilla-Keywords: X-Bugzilla-Severity: minor X-Bugzilla-Who: chrbr at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Tue, 24 May 2011 12:55: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: 2011-05/txt/msg02182.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49139 Summary: always_inline attribute inconsistencies Product: gcc Version: unknown Status: UNCONFIRMED Severity: minor Priority: P3 Component: regression AssignedTo: unassigned@gcc.gnu.org ReportedBy: chrbr@gcc.gnu.org Created attachment 24340 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24340 fails even without -Winline Hello, I'm wondering whether or not the always_inline in PIC must prevails over the general preemption rules. Apparently not accordingly to the default behavior for the compilation in -O2 -fpic of __attribute((always_inline)) void bar() { } void test(void) { bar(); } foo.c:1:35: sorry, unimplemented: inlining failed in call to 'bar': function body can be overwriten at linktime foo.c:5:6: sorry, unimplemented: called from here First (1): inlining cannot be done, So without -Werror, this should be a warning, not a "sorry error". Or (2): The function could be inlined, despite the preemption rule. But it is just not yet implemented. In this case. In case of (1), I'm attaching here a C++ reduced piece of code that triggers this error even without using -Winline, making the error quite unpredictable, since this depends of the presence of another inlined call (here, "Alloc"), forcing a call to "expand_call_inline" producing the same effect than -Winline (as shown with a breakpoint in ipa-inline-transform:306 on trunk) So which one of the strategies is good: Fixing the warning, and make sure that it only (and consistently) occurs when -Winline is used, or always honoring the always_inline attribute despite visibility potential issues, considering that a user directive bypass the defaults ? Thanks, Christian