This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: On inlining in C++
- From: dewar at gnat dot com (Robert Dewar)
- To: dewar at gnat dot com, jbuck at synopsys dot com
- Cc: gcc at gcc dot gnu dot org, gdr at integrable-solutions dot net
- Date: Mon, 4 Aug 2003 13:38:41 -0400 (EDT)
- Subject: Re: On inlining in C++
>
> Option 1: a version of GNU C++ that
>
> * honors the "inline" keyword in all situations where the compiler is
> capable of inlining the call
> * does the same for functions defined in the class body
> * when -Winline is given, issues a warning and explanation about why
> a call is not inlined
> * avoids computing any metrics related to inlining decisions (unless -O3)
>
> Option 2: a version of GNU C++ that uses the smartest heuristics that the
> "ignore inline" advocates can come up with.
Indeed, this is exactly the experiment that is required, and I suspect the
best resolution is to have this controllable by a switch. The issue of
what the best setting for the switch is is another discussion, and for
example depends on how well gdb handles inlining.