On inlining in C++

Robert Dewar dewar@gnat.com
Mon Aug 4 17:41:00 GMT 2003


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



More information about the Gcc mailing list