https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100376
--- Comment #2 from cqwrteur <unlvsur at live dot com> --- (In reply to cqwrteur from comment #1) > What thing very wierd is that the code runs correctly under wine but > incorrect on windows, even it is the same program. > > D:\hg\fast_io\.tmp\vdso>g++ -o test test.cc -Ofast -std=c++20 -s -flto > -march=native -I../../include > > D:\hg\fast_io\.tmp\vdso>test > 3 > 0 > > D:\hg\fast_io\.tmp\vdso>g++ -o test test.cc -Ofast -std=c++20 -s -flto > -march=native -I../../include -static > > D:\hg\fast_io\.tmp\vdso> > D:\hg\fast_io\.tmp\vdso>test > 3 > 3 > > It looks this is an issue with libstdc++.dll's abi?? maybe I missed > something here? Oh. i understand what is happening here. I installed too many versions of libstdc++.dll, they conflict with each other. Does windows have a version checker for dlls like Linux does?