This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch objc]: Fix varios regressions for windows targets
>>> Additionally I
>>> noticed that some of the export API in library was marked by 'inline',
>>> which seems to me more like a general bug, as by this not necessarily
>>> the exported libary will contain this API symbol at all.
>>
>> ÂAccording to PR43601(*), it is the current (and by design) behaviour that
>> dllexported inlines are always emitted, and this is apparently what MSVC also
>> does, so that shouldn't happen.
>>
>> Â Âcheers,
>> Â Â ÂDaveK
>> --
>> (*) - http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601
>>
> The issue I noticed was a bit different here. The function itself in
> implementation was marked as inline, but not as dllexport'ed. Even the
> prototype of it didn't marked it.
Kai,
you are right that there was a problem there. For example, objc_msg_lookup()
was marked "inline" in the implementation (but not in the header), but actually
never used in the local compilation unit. So the "inline" part wasn't really
ever used, and it was just confusing. ;-)
But get_imp() is a different case, because it is called inside objc_msg_lookup()
and objc_msg_lookup_super() (in the same file) and it's on the critical path for
messaging, so it's probably one of the few places were inlining is really
critical! ;-)
I checked the generated code, and indeed get_imp() was no longer inlined. I reverted
just that line of your patch and put the 'inline' code for it back. Apologies for not
spotting that before. Let me know if it breaks anything on MinGW32 (it shouldn't
according to your explanation), in which case we'll have to think of something else so
that we can keep get_imp() inlined locally, but have the exports work. ;-)
Thanks