> > The first bug was already reported three years ago: > > http://marc.info/?l=openbsd-bugs&m=135732012310459 > > std::ifstream has a bug when linked with libpthread:
This is a compiler bug. Compiling libstdc++ with -O0 yields a working binary. And of course, compiling libstdc++ with as few optimization as possible, i.e. -O1 -fno-var-tracking -fno-defer-pop -fno-branch-probabilities -fno-cprop-registers -fno-if-conversion -fno-if-conversion2 -fno-ipa-pure-const -fno-ipa-reference -fno-tree-ccp -fno-tree-dce -fno-tree-dominator-opts -fno-tree-dse -fno-tree-ter -fno-tree-lrs -fno-tree-sra -fno-tree-copyrename -fno-tree-fre -fno-tree-copy-prop -fno-tree-sink -fno-tree-salias -fno-unit-at-a-time, triggers the issue again.
