public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/18071] New: -Winline does not respect -fno-default-inline
@ 2004-10-20  5:47 markus at oberhumer dot com
  2005-04-29 18:30 ` [Bug middle-end/18071] [3.4/4.0/4.1 Regression] " mmitchel at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: markus at oberhumer dot com @ 2004-10-20  5:47 UTC (permalink / raw)
  To: gcc-bugs

-Winline does not respect -fno-default-inline (this is split out of bug17115,
and a possible 3.3 regression).

Consider this code:

struct Foo {
            int a(int r) { return r & 1; }
    virtual int b(int r) { return r & 2; }
    static  int c(int r) { return r & 4; }
};

int bar(int r) {
    Foo f; int k = 0;
    k |= f.a(r); k |= f.b(r); k |= f.a(r);
    return k;
}

> g++-3.3 -c -O2 -fno-default-inline -Winline test.cpp
> g++-3.4 -c -O2 -fno-default-inline -Winline test.cpp
test.cpp: In function `int bar(int)':
test.cpp:6: warning: inlining failed in call to 'int Foo::a(int)': --param
max-inline-insns-single limit reached
test.cpp:13: warning: called from here
test.cpp:7: warning: inlining failed in call to 'virtual int Foo::b(int)':
--param max-inline-insns-single limit reached
test.cpp:13: warning: called from here
test.cpp:6: warning: inlining failed in call to 'int Foo::a(int)': --param
max-inline-insns-single limit reached
test.cpp:13: warning: called from here
test.cpp:6: warning: inlining failed in call to 'int Foo::a(int)': --param
max-inline-insns-single limit reached
test.cpp:13: warning: called from here
test.cpp:7: warning: inlining failed in call to 'virtual int Foo::b(int)':
--param max-inline-insns-single limit reached
test.cpp:13: warning: called from here
test.cpp:6: warning: inlining failed in call to 'int Foo::a(int)': --param
max-inline-insns-single limit reached
test.cpp:13: warning: called from here


Futhermore, the warnings disappear if you use -O3 instead of -O2, so -O3 seems
to silently override -fno-default-inline (at least a documentation bug).


Full test program and log file will follow as attachment.

-- 
           Summary: -Winline does not respect -fno-default-inline
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: markus at oberhumer dot com
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i386-linux-gnu


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


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2009-04-29 15:19 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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 Regression] -Winline does not respect -fno-default-inline 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
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 ` hubicka at ucw dot cz
2008-01-15 16:10 ` rguenther at suse dot de
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
2004-10-20  5:47 [Bug c++/18071] New: " markus at oberhumer dot com
2005-04-29 18:30 ` [Bug middle-end/18071] [3.4/4.0/4.1 Regression] " mmitchel at gcc dot gnu dot org
2005-05-19 17:39 ` mmitchel at gcc dot gnu dot org
2005-07-22 21:16 ` pinskia at gcc dot gnu dot org
2005-09-27 16:09 ` mmitchel at gcc dot gnu dot org

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).