From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24518 invoked by alias); 27 May 2011 14:34:39 -0000 Received: (qmail 24435 invoked by uid 22791); 27 May 2011 14:34:39 -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; Fri, 27 May 2011 14:34:25 +0000 From: "chrbr at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/49139] always_inline attribute inconsistencies X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: chrbr at gcc dot gnu.org X-Bugzilla-Status: REOPENED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: chrbr at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: AssignedTo 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: Fri, 27 May 2011 14:38: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/msg02686.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49139 chrbr at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot |chrbr at gcc dot gnu.org |gnu.org | --- Comment #6 from chrbr at gcc dot gnu.org 2011-05-27 14:34:05 UTC --- Created attachment 24372 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24372 always generates an error on always_inline failure The attached testcases illustrate the current diagnostics on always_inline failures" - success with and without -Winline, although always_inline is not honored gcc fail_always_inline1.c -S -Winline -O0 -fpic gcc fail_always_inline1.c -S -O2 -fpic - error: "sorry, unimplemented:" with -Winline only gcc fail_always_inline1.c -S -Winline -O2 -fpic - error: "sorry, unimplemented" without -Winline gcc fail_always_inline2.c -S -fno-early-inlining -O2 or the original c++ attachment in this defect The attached patch always emits an error (and change sorry into error). In particular it fixes the case where the inlining was not honored and not detected. note that the error is emitted even if -Winline is not specified. Since this reflects a misuse of the attribute and it is close to the actual behavior Note that I stepped back on my initial proposal to emit a hint message suggesting to use the "inline" keyword (if not defined in a C++ class), because there are cases where even with "inline" the function would not be inlined. Tested with standard bootstrap and regression testing on x86 (with tests modification the diagnostic checks). I also double checked for legacy issues with a full rebuild of a linux distribution. Thanks,