public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/18071] [4.0/4.1/4.2/4.3 Regression] -Winline does not respect -fno-default-inline
Date: Mon, 17 Dec 2007 10:46:00 -0000	[thread overview]
Message-ID: <20071217104612.13368.qmail@sourceware.org> (raw)
In-Reply-To: <bug-18071-4672@http.gcc.gnu.org/bugzilla/>



------- Comment #29 from manu at gcc dot gnu dot org  2007-12-17 10:46 -------
(In reply to comment #28)
> Open regression with no activity since February 14.  Ping?
> 

The last thread about this was in:
http://gcc.gnu.org/ml/gcc-patches/2007-07/msg00523.html

Summarising:

* C++ front-end sets  DECL_DECLARED_INLINE_P for methods always. It sets
DECL_INLINE unless -fno-default-inline.

* -Winline warns when a function "declared inlined" is not inlined.  Currently,
"declared inline" means DECL_DECLARED_INLINE_P is set. 

* DECL_DECLARED_INLINE_P controls linkage.

* -fno-default-inline should not affect linkage.


Geoff Keating said: 

"DECL_DECLARED_INLINE_P in the C++ front-end means 'this function is an "inline
function" as defined by the standard'. There are two ways to get a function to
be an inline function: (a) the 'inline' keyword, and (b) define the function
inside a class; the ways are equivalent from the language's perspective. See
[dcl.fct.spec] in the C++ standard, especially paragraphs 2 and 3.

The question here is whether -Winline should be limited to those inline
functions in case (a) or whether it can include those in case (b) too."


Therefore, if -Winline also include case (b) then the warning seems correct. A
function that was declared inline was not inlined. Alternatively, we could not
warn for -fno-default-inline but then we would have to detect that: 1)
-fno-default-inline was given, 2) this is a method, 3) it wasn't declared using
the 'inline' keyword.

On the other hand, if -Winline is limited to case (a), then we need a way to
distinguish between (a) and (b).

Therefore, either the warning is correct and this is not a bug, or we need a
way to distinguish between (a) and (b). At least, this is how I see. I wouldn't
mind to implement other solution if one is clearly described and agreed.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18071


  parent reply	other threads:[~2007-12-17 10:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-18071-4672@http.gcc.gnu.org/bugzilla/>
2005-10-31  1:32 ` [Bug middle-end/18071] [3.4/4.0/4.1 " mmitchel at gcc dot gnu dot org
2005-11-04  4:32 ` wilson at gcc dot gnu dot org
2006-02-24  0:25 ` [Bug middle-end/18071] [3.4/4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
2006-05-25  2:37 ` [Bug middle-end/18071] [4.0/4.1/4.2 " mmitchel at gcc dot gnu dot org
2006-08-05  8:17 ` bonzini at gnu dot org
2006-09-30 12:36 ` lopezibanez at gmail dot com
2006-10-02 19:23 ` wilson at gcc dot gnu dot org
2006-10-02 19:25 ` wilson at tuliptree dot org
2006-10-02 21:03 ` lopezibanez at gmail dot com
2007-01-16 19:46 ` [Bug middle-end/18071] [4.0/4.1/4.2/4.3 " patchapp at dberlin dot org
2007-02-14  9:03 ` mmitchel at gcc dot gnu dot org
2007-12-16 23:16 ` steven at gcc dot gnu dot org
2007-12-17 10:46 ` manu at gcc dot gnu dot org [this message]
2008-01-15 15:33 ` rguenth at gcc dot gnu dot org
2008-01-15 15:33 ` rguenth at gcc dot gnu dot org
2008-01-15 16:08 ` hubicka at gcc dot gnu dot org
2008-01-15 16:10 ` rguenther at suse dot de
2008-01-15 16:10 ` hubicka at ucw dot cz
2008-01-15 17:21 ` manu at gcc dot gnu dot org
2008-07-04 16:35 ` [Bug middle-end/18071] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2008-09-17 15:03 ` hubicka at gcc dot gnu dot org
2008-09-21 13:09 ` steven at gcc dot gnu dot org
2009-04-29 15:19 ` pinskia at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071217104612.13368.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).