https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70962
Bug ID: 70962
Summary: optimization not working in Red Hat 5.7 after glibc
patching
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: chita40 at gmail dot com
Target Milestone: ---
$ cat tt.c
#include <fstream>
#include <iostream>
int main( const int argc, const char * argv[] )
{
std::ifstream in;
in.open( "/dev/null", std::ios::in );
if (in.is_open() ) {
std::cout << "opened" << std::endl;
} else {
std::cout << "failed" << std::endl;
}
return 0;
}
$ g++ tt.c && a.out
opened
$ g++ -O2 tt.c && a.out
failed