http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53308
Bug #: 53308 Summary: AIX 5.3 segmentation fault with basic_ofstream, pthread and -O2 Classification: Unclassified Product: gcc Version: 4.4.7 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: ask...@appfluent.com Created attachment 27365 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27365 This is the preprocessed file On AIX 5.3, this program has a segmentation fault when built using both pthread and O2. It runs normally when that particular combination is not used. Source file: t.cpp #include <fstream> int main(int argc, char** argv) { std::basic_ofstream<char> f("a.txt", std::ios::out); return 0; } g++ -v Using built-in specs. Target: powerpc-ibm-aix5.3.0.0 Configured with: /home/askees/gcc/gcc-4.4.7/configure --prefix=/usr/local/gnu/gcc/gcc-4.4.7 --with-gmp=/usr/local/gnu/gmp/gmp-5.0.1 --with-mpfr=/usr/local/gnu/mpfr/mpfr-2.4.2 --enable-threads=posix --enable-languages=c,c++ --with-as=/usr/bin/as --with-ld=/usr/bin/ld --host=powerpc-ibm-aix5.3.0.0 --target=powerpc-ibm-aix5.3.0.0 --build=powerpc-ibm-aix5.3.0.0 Thread model: aix gcc version 4.4.7 (GCC) Compile g++ t.cpp -O2 -L/usr/lib/threads -pthread