This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++/2907: libstdc++ compiled with optimization fails to initialize ios.



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]