This is the mail archive of the gcc@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]

question on inlining functions vs. member functions


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

Attachment: func.s
Description: Binary data

Attachment: memberfunc.s
Description: Binary data


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