[PATCH] Fix backwards compatibility problem in libstdc++

Paolo Carlini pcarlini@suse.de
Tue Oct 17 12:09:00 GMT 2006


Paolo Carlini wrote:

>> The inlining of _S_construct and not inlining of _S_create is in
>> gcc 3.4.x compiled libboost_regex.a(c_regex_traits.o).  I haven't 
>> compiled
>> that one myself to see exactly why one was inlined and the other was 
>> not,
>> but the inliner certainly has the right to do so if it thinks it is a 
>> win. 
>
> To be clear: I'm not saying that, at the time, we carefully pondered 
> this possibility, I didn't at least, my bad. Only, I'm having trouble 
> reproducing the problem with small snippets. Probably the fact that 
> _S_construct is static is essential (I'm seeing static functions often 
> inlined even when not marked as such) together with the fact that the 
> caller of _S_contruct is out of line, yet tiny. Likely -O3 may have 
> sufficed, at least on some arches.

 From a practical point of view the issue is now closed, but wanted to 
clarify that in this exchange we used the term "inlining" in a loose 
sense (which, at first, diverted me from the real point). Actually, in 
all the cases I finally saw, the problem was not with an *inlined* 
_S_construct, but with *weak* _S_construct in user code, that is an 
instantiation of the templatized overload called by the templatized 
string constructor (in fact, it happened also at -O0!).

Paolo.



More information about the Libstdc++ mailing list