question on inlining functions vs. member functions

Benjamin Kosnik bkoz@redhat.com
Tue Feb 4 18:20:00 GMT 2003


Hey y'all.

I've got some code that gives me odd g++ output. For some
reason, the same code sequence gets inlined as a function, but not
inlined as a member function. I'm hoping one or both of you could give
me some insights on why this is the case, so that I'll be more effective
in tuning the C++ runtime.

The preference is to use a member function, but to have it inlined.

There are two attachments: one for the inlined function, and one for the
member funtion. Both have sample code and generated asm (both asm
sequences are from head gcc, with -O2). I've not noticed any difference
in what gets inlined between 3.2, 3.3, and 3.4.

(I forced the inlined function asm to be generated by removing the
inline keyword.)

thanks,
benjamin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: func.s
Type: application/octet-stream
Size: 2542 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20030204/678b71ee/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: memberfunc.s
Type: application/octet-stream
Size: 1980 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20030204/678b71ee/attachment-0001.obj>


More information about the Gcc mailing list