Compiling code below (g++ -O5 -c) fails with the error message below.
This is the major source of performance loss since it leaves silly functions
like this called zillions of times w/out inlining.
Any workaround ?
Yuri
---- code ----
template<typename T> __attribute__ ((__always_inline__)) T f(const T j) { return
(j); }
int x(int j) {
int r;
r = f(j);
return (r);
}
---- error message ----
i.C:2: sorry, unimplemented: inlining failed in call to 'T f(T) [with T = int]':
function not inlinable
i.C:6: sorry, unimplemented: called from here
--
Summary: __always_inline__ fails on templetized function for no
reason
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: yuri at tsoft dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20340