mingw will use __sync_fetch_and_add for atomic, but on 64bit target the pointer will cast to long and the high 32 bits of the pointer will be lost. so mingw should use the same logic as msvc
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
compiler-rt/lib/profile/CMakeLists.txt | ||
---|---|---|
3–4 | I think this one needs to be lowercased to work properly in mingw cross compile setups. | |
compiler-rt/lib/profile/InstrProfilingPort.h | ||
58 | Can this cause warnings if _MSC_VER isn't defined? Would it be safer to change it into #if defined(_MSC_VER) && _MSC_VER < 1900? |
LGTM.
compiler-rt/lib/profile/InstrProfilingPort.h | ||
---|---|---|
58 | Technically not necessary, since the preprocessor will replace any unrecognized macro name in a #if- or #elif-conditional with 0. But I believe this makes the intent clearer. |
@hans - @SquallATF wants this one backported to the 11.x release branch, which I think is reasonable - but maybe after waiting for a day or two in case there's any surprise.
I think this one needs to be lowercased to work properly in mingw cross compile setups.