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
  2004-10-20  5:49 ` [Bug c++/18071] " markus at oberhumer dot com
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ 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] 19+ messages in thread

end of thread, other threads:[~2005-09-27 16:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-20  5:47 [Bug c++/18071] New: -Winline does not respect -fno-default-inline markus at oberhumer dot com
2004-10-20  5:49 ` [Bug c++/18071] " markus at oberhumer dot com
2004-10-20 14:00 ` [Bug c++/18071] [3.4/4.0 Regression] " pinskia at gcc dot gnu dot org
2004-10-20 21:52 ` [Bug middle-end/18071] " giovannibajo at libero dot it
2004-11-01  0:46 ` mmitchel at gcc dot gnu dot org
2004-11-23 13:34 ` giovannibajo at libero dot it
2004-11-23 13:41 ` pinskia at gcc dot gnu dot org
2004-11-24  0:34 ` steven at gcc dot gnu dot org
2004-11-24  1:54 ` giovannibajo at libero dot it
2004-11-24 16:57 ` joseph at codesourcery dot com
2004-11-25  0:21 ` giovannibajo at libero dot it
2004-11-30 11:25 ` giovannibajo at libero dot it
2004-11-30 19:54 ` markus at oberhumer dot com
2004-12-01  7:15 ` giovannibajo at libero dot it
2005-01-21  2:11 ` markus at oberhumer dot com
2005-04-29 18:30 ` [Bug middle-end/18071] [3.4/4.0/4.1 " 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).