Issue Details (XML | Word | Printable)

Key: STDCXX-415
Type: Bug Bug
Status: Resolved Resolved
Resolution: Cannot Reproduce
Priority: Minor Minor
Assignee: Travis Vitek
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

[gcc 3.3.3] __rw_utf8toucs4() too big to be inlined

Created: 15/May/07 07:45 PM   Updated: 26/Feb/08 10:31 PM
Return to search
Component/s: Build and Installation
Affects Version/s: 4.1.3
Fix Version/s: 4.2.1

Time Tracking:
Original Estimate: 2h
Original Estimate - 2h
Remaining Estimate: 0h
Time Spent - 4.03h
Time Spent: 4.03h
Time Spent - 4.03h

Environment: gcc 3.3.3 (SuSE Linux)

Severity: Compiler Warning
Resolution Date: 26/Feb/08 10:31 PM


 Description  « Hide
We're getting a few warnings for the __rw_utf8toucs4() inline function indicating that the function is too big to be inlined. It might be a good idea to split it up into two, a simple inline wrapper to handle the common case for single and perhaps two-byte characters and a bigger out-of-line implementation to handle the more complicated multibyte characters.
c++ -O2   -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align  -fPIC  /amd/devco/sebor/stdcxx/src/wctype.cpp
gencat rwstderr.cat /amd/devco/sebor/stdcxx/src/rwstderr.msg
/amd/devco/sebor/stdcxx/src/wcodecvt.cpp: In member function `virtual int 
   std::codecvt_byname<wchar_t, char, __mbstate_t>::do_length(__mbstate_t&, 
   const char*, const char*, unsigned int) const':
/amd/devco/sebor/stdcxx/include/loc/_localedef.h:735: warning: inlining failed 
   in call to `const char* __rw::__rw_utf8toucs4(int*, const char*, const 
   char*)'
/amd/devco/sebor/stdcxx/src/wcodecvt.cpp:964: warning: called from here
In file included from /amd/devco/sebor/stdcxx/src/wcodecvt.cpp:1065,
                 from /amd/devco/sebor/stdcxx/src/wcodecvt.cpp:1621:
/amd/devco/sebor/stdcxx/include/loc/_localedef.h:735: warning: inlining failed 
   in call to `const char* __rw::__rw_utf8toucs4(int*, const char*, const 
   char*)'
/amd/devco/sebor/stdcxx/src/wcodecvt.cpp:964: warning: called from here
/amd/devco/sebor/stdcxx/src/wcodecvt.cpp: In member function `virtual 
   std::codecvt_base::result std::codecvt_byname<wchar_t, char, 
   __mbstate_t>::do_in(__mbstate_t&, const char*, const char*, const char*&, 
   wchar_t*, wchar_t*, wchar_t*&) const':
/amd/devco/sebor/stdcxx/include/loc/_localedef.h:735: warning: inlining failed 
   in call to `const char* __rw::__rw_utf8toucs4(int*, const char*, const 
   char*)'
/amd/devco/sebor/stdcxx/src/wcodecvt.cpp:736: warning: called from here
In file included from /amd/devco/sebor/stdcxx/src/wcodecvt.cpp:1396:
/amd/devco/sebor/stdcxx/include/loc/_localedef.h:735: warning: inlining failed 
   in call to `const char* __rw::__rw_utf8toucs4(int*, const char*, const 
   char*)'
/amd/devco/sebor/stdcxx/src/wcodecvt.cpp:736: warning: called from here


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor added a comment - 23/Aug/07 04:10 AM
Scheduled for after 4.2.

Scott (Yu) Zhong added a comment - 13/Feb/08 06:41 PM
cannot reproduce the error on 4.2.x branch

uname -a && gcc -v && gcc -c -I/amd/devco/scottz/stdcxx/4.2.x/include/ansi -I/amd/devco/scottz/stdcxx/4.2.x/include -I/build/scottz/4.2.x/11s/include -pedantic -nostdinc++ -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long -Wcast-align /amd/devco/scottz/stdcxx/4.2.x/src/wctype.cpp
Linux darts 2.6.5-7.244-smp #1 SMP Mon Dec 12 18:32:25 UTC 2005 x86_64 x86_64 x86_64 GNU/Linux
Reading specs from /amd/packages/mdx/suse/amd64/compilers/gcc/3.3.3-43.41/bin/../lib/gcc-lib/x86_64-suse-linux/3.3.3/specs
Configured with: ../configure -enable-threads=posix --prefix=/nfs/packages/mdx/suse/amd64/compilers/gcc/3.3.3-43.41 --with-local-prefix=/usr/local --infodir=/nfs/packages/mdx/suse/amd64/compilers/gcc/3.3.3-43.41/info --mandir=/nfs/packages/mdx/suse/amd64/compilers/gcc/3.3.3-43.41/man --enable-languages=c,c+,f77,objc,java --disable-checking --libdir=/nfs/packages/mdx/suse/amd64/compilers/gcc/3.3.3-43.41/lib --enable-libgcj --with-gxx-include-dir=/nfs/packages/mdx/suse/amd64/compilers/gcc/3.3.3-43.41/include/g+ --with-slibdir=//nfs/packages/mdx/suse/amd64/compilers/gcc/3.3.3-43.41/lib --with-system-zlib --enable-shared --enable__cxa_atexit x86_64-suse-linux
Thread model: posix
gcc version 3.3.3 (SuSE Linux)


Martin Sebor added a comment - 16/Feb/08 12:30 AM
FWIW, many/most of these warnings have disappeared since gcc 3.3. I'm not sure if it's because the inliner has been changed to handle bigger functions or because the gcc maintainers have simply silenced the warnings. It might be worthwhile to look at the disassembly to see what the deal is. If it turns out that the function still is too big to be inlined (it looks like it might be), breaking it up into 2, an inline one that handles, say, 1 and 2-byte characters, and an out-of-line one that does the rest, might be a reasonably efficient compromise.

Travis Vitek added a comment - 26/Feb/08 10:00 PM
The function is inlined into __rw_libstd_do_in() in -O1 builds. The function __rw_libstd_do_in() and its callee __rw_utf8toucs4() are inlined into codecvt_byname<>::do_in() with -O2 builds.

Martin Sebor added a comment - 26/Feb/08 10:13 PM
Sounds like we can close this issue as Not a Bug then, no?