This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/11382] New: G++ emits spurious "inlining failed" warnings


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: G++ emits spurious "inlining failed" warnings
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: wirawan0 at softhome dot net
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu

GNU C++ 3.3 emits lots of spurious "inlining failure" warnings when compiling a
C++ program with external references.

HOW TO REPRODUCE WARNING: Compile the sample file (see below) with option -O3
-Winline. In my machine, it yields

~/Work/BUGS $ /usr/local/gcc-3.3/bin/g++  -Winline -O3 -c buggy.cpp
buggy.cpp: In function `void test()':
buggy.cpp:1: warning: inlining failed in call to `void ExternProc()'
buggy.cpp:5: warning: called from here


COMMENT: this should not happen! The ExternProc() is an external subroutine,
and it has no definition. It is not possible to inline this function, and
therefore the warning should not be emitted.

Try to recompile this file with gcc (not g++) 3.3, but with its extension
changed to ".c": such a warning would not be printed out.

GCC INFO:

~/Work/BUGS $ /usr/local/gcc-3.3/bin/g++ -v
Reading specs from /usr/local/gcc-3.3/lib/gcc-lib/i686-pc-linux-gnu/3.3/specs
Configured with: /misc/build/gcc-3.3/configure --prefix=/usr/local/gcc-3.3
--disable-nls --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.3

SAMPLE FILE: (save it with .C, .cc, or .cpp extension):

#line 1 "buggy.cpp"
extern void ExternProc(); /* supposedly this is the external procedure */

void test()
{
    ExternProc();
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]