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++/16571] New: g++ spits out a lot of "inlining failure" messages which should not have happened


I suspect that this error happens only on large C++ files (i.e. it may have to
do with the complication there), so I included in the attachments some
"real" files to reproduce the error messages. I also gave you the error
messages as printed on the screen. I use script(1) program to capture the
output. I am not sure if these errors can be reproduced only with small
testcases. (?) Sorry if this is inconvenient. Please read through this
error report first, before going to the files. They are like forest.

WRONG INLINING FAILURE

In the error messages, g++ spits out quite a bit of "inlining failures",
which were caused by "function body not available".  This is not correct.
Consider line 19 of inline-errors.txt [reformatted]:

./src/cp.inc/Matrix.cpp:401: warning: inlining failed in call to
  'Matrix<_number>::Matrix(const Matrix<_number>&)
  [with _number = QMBS_Observables_QMCStats::value_type]':
  function body not available

If you see in tbhqmc-results.ii line 19613, the function body (definition)
was there! I suspect that this may have to do with the earlier 3 inlining
failures ("--param large-function-growth limit reached while inlining the
caller") reported in lines 10, 12, 14 of inline-errors.txt.

Sure enough, when I added `--param large-function-growth=900' in the
compilation switch, those subsequent inlining failures due to "function
body not available" were gone!

BTW, the constructor Matrix<_number>::Matrix(const Matrix<_number> &src)
is small in size, and therefore should be inlineable:

template <class _number> inline
Matrix<class _number>::Matrix(const Matrix<class _number> &src)
{
    if (src.isnull())                       // a small function
    {
        M = NULL;
        rows = cols = 0;
    }
    else
    {
        init(src.Rows(), src.Cols());       // a small function
        FastCopy(*(src.M), *M, rows*cols);  // this is also a small function
    }
}

REPRODUCING THE ERROR

Use the stock g++ 3.4.1. The following is the command that should give the
same output as in inline-errors.txt (except for header and footer lines
from script(1)):

g++ -Wall -Winline -fno-exceptions -O3 -finline-limit=8000 -c tbhqmc-results.ii


VERSION KNOWN TO BE AFFECTED: 3.4.1

My gcc gives the following version/compilation info:

~/Projects/BUGS/gcc-3.4.1-inline-fails $ g++ -v
Reading specs from /usr/local/gcc-3.4.1/lib/gcc/i686-pc-linux-gnu/3.4.1/specs
Configured with: ../gcc-3.4.1/configure --prefix=/usr/local/gcc-3.4.1
--disable-nls --enable-languages=c,c++,f77 --enable-shared --with-cpu=i686
--with-tune=i686 --with-arch=i686 --enable-threads=posix
--enable-__cxa_atexit
Thread model: posix
gcc version 3.4.1

-- 
           Summary: g++ spits out a lot of "inlining failure" messages which
                    should not have happened
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Severity: normal
          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


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


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