Help! C++ library miscompilation from current CVS

Chip Salzenberg
Fri Jun 2 16:42:00 GMT 2000

When bootstrapping with libstdc++-v3, the current CVS sources
miscompile a key function and prevent any significant C++ programs
from running at all.

I've attached the preprocessed source based on libstdc++-v3/src/
and the portion of the assembler generated for the function:

  locale::_Impl::_M_install_facet(const locale::id* __idp, facet* __fp)

In the assembler output, near the end of this function, there is a
load instruction: "movl -180(%ebp), %esi".  However, "-180(%ebp)" is
not the target of any store operations before that statement executes.
The result is a wild pointer and a SIGSEGV.

There _is_ an store operation to "-180(%ebp)" elsewhere in the
function, but it doesn't get executed in time.  I suspect, based on my
vague memory of recent patches, that the basic blocks of the function
have been mis-ordered.  But that's just a first guess.

Here is my configuration:

    SRC/configure --with-gcc-version-trigger=/u/build/gcc/egcs/SRC/gcc/version.c --host=i686-pc-linux-gnu --prefix=/usr/local/egcs --enable-languages=objc,c++ --enable-threads=posix --enable-shared --enable-version-specific-runtime-libs --enable-libstdcxx-v3 --enable-namespaces --enable-long-long --norecursion 

Chip Salzenberg              - a.k.a. -              <>
"I wanted to play hopscotch with the impenetrable mystery of existence,
    but he stepped in a wormhole and had to go in early."  // MST3K
-------------- next part --------------
A non-text attachment was scrubbed...
Name: locale.i.gz
Type: application/x-gzip
Size: 67373 bytes
Desc: not available
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: locale.s.bug.gz
Type: application/x-gzip
Size: 2406 bytes
Desc: not available
URL: <>

More information about the Gcc-bugs mailing list