public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: libstdc++/2907: libstdc++ compiled with optimization fails to initialize ios.
@ 2001-05-22 20:06 Carlo Wood
0 siblings, 0 replies; 4+ messages in thread
From: Carlo Wood @ 2001-05-22 20:06 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/2907; it has been noted by GNATS.
From: Carlo Wood <carlo@alinoe.com>
To: gcc-gnats@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org
Subject: Re: libstdc++/2907: libstdc++ compiled with optimization fails to initialize ios.
Date: Wed, 23 May 2001 04:58:57 +0200
After compiling as above, and using the given test program that links
directly with the compiled (not installed) libstdc++:
~/c++/libcw/src/libcwd/testsuite>ldd a.out
librmalloc.so.1 => /home/carlo/c++/rmalloc/librmalloc.so.1 (0x40018000)
libstdc++.so.3 => /usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.3 (0x4001d000)
libm.so.6 => /lib/libm.so.6 (0x4015d000)
libgcc_s.so.0 => /usr/src/gcc/gcc-objdir-3.0/gcc/libgcc_s.so.0 (0x4017e000)
libc.so.6 => /lib/libc.so.6 (0x40188000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
in a different environment (not affecting the environment where I am compiling the
stdc++ library) (note that rmalloc is used to make sure there is no memory corruption
involved), I did the following tests:
/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src>grep '^CXXFLAGS =' Makefile
CXXFLAGS = -O9 -march=pentiumpro -fomit-frame-pointer -D_GNU_SOURCE
~/c++/libcw/src/libcwd/testsuite>a.out 2> /dev/null
Segmentation fault (core dumped)
/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src>vi Makefile
/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src>grep '^CXXFLAGS =' Makefile
CXXFLAGS = -O9 -D_GNU_SOURCE
/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src>rm *.lo *.o
/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src>make > /dev/null
~/c++/libcw/src/libcwd/testsuite>a.out 2> /dev/null
~/c++/libcw/src/libcwd/testsuite>
Conclusion: the problem is either -march=pentiumpro or -fomit-frame-pointer
And so on...
CXXFLAGS in src/Makefile result
-O9 -march=pentiumpro : no core
-fomit-frame-pointer : no core
-O9 -fomit-frame-pointer : core
-O2 -fomit-frame-pointer : core
-O -fomit-frame-pointer : core
-fomit-frame-pointer : no core
Next I started to compile the files one by one with -O -fomit-frame-pointer.
basic_file : no core
bitset : no core
c++locale : no core
codecvt : no core
complex_io : no core
functexcept : no core
globals : no core
ios : no core
limitsMEMBERS : no core
locale-inst : no core
locale : core
Next I compiled all files with -O -fomit-frame-pointer *except* locale.cc, this
gave no core. Finally I recompiled all files with -O9 -march=pentiumpro -fomit-frame-pointer
except locale.cc, which was compiled with nothing. This still resulted in no core.
Conclusion, the problem is compiling locale.cc with -O -fomit-frame-pointer.
Next I started to use different options instead of -O for locale.lo, the rest still
compiled with -O9 -march=pentiumpro -fomit-frame-pointer.
CXXFLAGS in src/Makefile result
: no core
-O -fomit-frame-pointer : core
-fthread-jumps -fdefer-pop -fomit-frame-pointer : core
-fomit-frame-pointer : no core
-fdefer-pop -fomit-frame-pointer : core
-fthread-jumps -fomit-frame-pointer : no core
Final conclusion: The problem shows itself when compiling locale.cc with
"-fdefer-pop -fomit-frame-pointer", or to be exact:
/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src>make
/bin/sh ../libtool --tag CXX --mode=compile /usr/src/gcc/gcc-objdir-3.0/gcc/xgcc \
-B/usr/src/gcc/gcc-objdir-3.0/gcc/ -nostdinc++ -L/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src \
-L/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src/.libs -B/usr/local/gcc-3.0/i686-pc-linux-gnu/bin/ \
-B/usr/local/gcc-3.0/i686-pc-linux-gnu/lib/ -isystem /usr/local/gcc-3.0/i686-pc-linux-gnu/include -nostdinc++ \
-I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/include -I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/include/std \
-I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/include/c_std -I../include \
-I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/libsupc++ -I../libio -I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/libio \
-I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/libmath \
-fthread-jumps -fomit-frame-pointer -D_GNU_SOURCE \
-fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winline -fdiagnostics-show-location=once \
-ffunction-sections -fdata-sections -g -c /usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/src/locale.cc
--
Carlo Wood <carlo@alinoe.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libstdc++/2907: libstdc++ compiled with optimization fails to initialize ios.
@ 2001-05-22 20:16 Carlo Wood
0 siblings, 0 replies; 4+ messages in thread
From: Carlo Wood @ 2001-05-22 20:16 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/2907; it has been noted by GNATS.
From: Carlo Wood <carlo@alinoe.com>
To: gcc-gnats@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org
Subject: Re: libstdc++/2907: libstdc++ compiled with optimization fails to initialize ios.
Date: Wed, 23 May 2001 05:11:04 +0200
I hate it when I make errors :/ (but at least I correct myself within 10 minutes usually ;).
On Wed, May 23, 2001 at 04:58:57AM +0200, Carlo Wood wrote:
> -fdefer-pop -fomit-frame-pointer : core
> -fthread-jumps -fomit-frame-pointer : no core
>
>
> Final conclusion: The problem shows itself when compiling locale.cc with
> "-fdefer-pop -fomit-frame-pointer", or to be exact:
>
> /usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src>make
> /bin/sh ../libtool --tag CXX --mode=compile /usr/src/gcc/gcc-objdir-3.0/gcc/xgcc \
> -B/usr/src/gcc/gcc-objdir-3.0/gcc/ -nostdinc++ -L/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src \
> -L/usr/src/gcc/gcc-objdir-3.0/i686-pc-linux-gnu/libstdc++-v3/src/.libs -B/usr/local/gcc-3.0/i686-pc-linux-gnu/bin/ \
> -B/usr/local/gcc-3.0/i686-pc-linux-gnu/lib/ -isystem /usr/local/gcc-3.0/i686-pc-linux-gnu/include -nostdinc++ \
> -I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/include -I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/include/std \
> -I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/include/c_std -I../include \
> -I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/libsupc++ -I../libio -I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/libio \
> -I/usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/libmath \
> -fthread-jumps -fomit-frame-pointer -D_GNU_SOURCE \
^^^^^^^^^^^^^^
> -fno-implicit-templates -Wall -Wno-format -W -Wwrite-strings -Winline -fdiagnostics-show-location=once \
> -ffunction-sections -fdata-sections -g -c /usr/src/gcc/gcc-cvs-3.0/libstdc++-v3/src/locale.cc
That "-fthread-jumps" must be "-fdefer-pop" thus.
Sigh, ... (perhaps it the 5:09 am ... bed time?)
--
Carlo Wood <carlo@alinoe.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: libstdc++/2907: libstdc++ compiled with optimization fails to initialize ios.
@ 2001-05-22 18:26 Phil Edwards
0 siblings, 0 replies; 4+ messages in thread
From: Phil Edwards @ 2001-05-22 18:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR libstdc++/2907; it has been noted by GNATS.
From: Phil Edwards <pedwards@disaster.jaj.com>
To: carlo@alinoe.com
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/2907: libstdc++ compiled with optimization fails to initialize ios.
Date: Tue, 22 May 2001 19:58:22 -0400
On Wed, May 23, 2001 at 12:10:24AM -0000, carlo@alinoe.com wrote:
> >Description:
> A simple "hello world" program (anything that includes
> <iostream>) core dumps when certain configuration flags
> are used to compile gcc and libstdc++ is compiled with
> optimization.
> >How-To-Repeat:
> -m "CFLAGS='-O' LIBCFLAGS='-O0 -ggdb3' LIBCXXFLAGS='-O0 -ggdb3 -fno-implicit-templates'" \
> bootstrap
>
> Despite what one expects, this result in libstdc++ to be
> compiled with "-O9 -march=pentiumpro -fomit-frame-pointer".
What happens when you configure with --enable-debug ?
Phil
--
pedwards at disaster dot jaj dot com | pme at sources dot redhat dot com
devphil at several other less interesting addresses in various dot domains
The gods do not protect fools. Fools are protected by more capable fools.
^ permalink raw reply [flat|nested] 4+ messages in thread
* libstdc++/2907: libstdc++ compiled with optimization fails to initialize ios.
@ 2001-05-22 17:16 carlo
0 siblings, 0 replies; 4+ messages in thread
From: carlo @ 2001-05-22 17:16 UTC (permalink / raw)
To: gcc-gnats
>Number: 2907
>Category: libstdc++
>Synopsis: libstdc++ compiled with optimization fails to initialize ios.
>Confidential: no
>Severity: critical
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue May 22 17:15:59 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Carlo Wood
>Release: gcc-ss-20010521
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
A simple "hello world" program (anything that includes
<iostream>) core dumps when certain configuration flags
are used to compile gcc and libstdc++ is compiled with
optimization.
>How-To-Repeat:
None or all of the following might be needed to reproduce
the bug:
machine: athlon/K7 with linux kernel 2.4.4
distribution: mainly Redhat 7.0 but with a lot rawhide rpms
among which:
glibc-2.2-12
binutils-2.10.91.0.2-3
Snap shot 20010521 checked out using -r gcc_latest_snapshot
Configuration was done by running:
env CC=gcc CFLAGS="-O9 -march=pentiumpro -fomit-frame-pointer" \
CXXFLAGS="-O9 -march=pentiumpro -fomit-frame-pointer" \
./gcc-cvs-3.0/contrib/gcc_build \
-d /usr/src/gcc/gcc-cvs-3.0 \
-o ../gcc-objdir-3.0 \
-c "--prefix=/usr/local/gcc-3.0 --enable-shared --with-gnu-as --with-gnu-ld --enable-languages=c++" \
-m "CFLAGS='-O' LIBCFLAGS='-O0 -ggdb3' LIBCXXFLAGS='-O0 -ggdb3 -fno-implicit-templates'" \
configure
where /usr/src/gcc/gcc-cvs-3.0 is my source directory
and /usr/src/gcc/gcc-objdir-3.0 is my object directory.
Compilation was done by running:
env CC=gcc CFLAGS="-O9 -march=pentiumpro -fomit-frame-pointer" \
CXXFLAGS="-O9 -march=pentiumpro -fomit-frame-pointer" \
./gcc-cvs-3.0/contrib/gcc_build \
-d /usr/src/gcc/gcc-cvs-3.0 \
-o ../gcc-objdir-3.0 \
-c "--prefix=/usr/local/gcc-3.0 --enable-shared --with-gnu-as --with-gnu-ld --enable-languages=c++" \
-m "CFLAGS='-O' LIBCFLAGS='-O0 -ggdb3' LIBCXXFLAGS='-O0 -ggdb3 -fno-implicit-templates'" \
bootstrap
Despite what one expects, this result in libstdc++ to be
compiled with "-O9 -march=pentiumpro -fomit-frame-pointer".
After installation, a simple program like
#include <iostream>
int main(void) { return 0; }
core dumps when run.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-05-22 20:16 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-22 20:06 libstdc++/2907: libstdc++ compiled with optimization fails to initialize ios Carlo Wood
-- strict thread matches above, loose matches on Subject: below --
2001-05-22 20:16 Carlo Wood
2001-05-22 18:26 Phil Edwards
2001-05-22 17:16 carlo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).