1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Hack around a GCC ICE that was fixed in GCC 6.2

lib/Target/X86/AsmParser/X86AsmParser.cpp: In member function ‘void {anonymous}::X86AsmParser::SwitchMode(unsigned int)’:
lib/Target/X86/AsmParser/X86AsmParser.cpp:927:76:   in constexpr expansion of ‘AllModes.llvm::FeatureBitset::FeatureBitset(std::initializer_list<unsigned int>{((const unsigned int*)(& ._157)), 3u})’
include/llvm/MC/SubtargetFeature.h:56:12:   in constexpr expansion of ‘llvm::FeatureBitset::set(I)’
lib/Target/X86/AsmParser/X86AsmParser.cpp:927:76: internal compiler error: in fold_binary_loc, at fold-const.c:9921
     FeatureBitset AllModes({X86::Mode64Bit, X86::Mode32Bit, X86::Mode16Bit});
                                                                            ^

llvm-svn: 369852
This commit is contained in:
Benjamin Kramer 2019-08-24 16:19:32 +00:00
parent 3f21644356
commit 485d114624

View File

@ -62,17 +62,23 @@ public:
}
constexpr FeatureBitset &set(unsigned I) {
Bits[I / 64] |= uint64_t(1) << (I % 64);
// GCC <6.2 crashes if this is written in a single statement.
uint64_t NewBits = Bits[I / 64] | (uint64_t(1) << (I % 64));
Bits[I / 64] = NewBits;
return *this;
}
constexpr FeatureBitset &reset(unsigned I) {
Bits[I / 64] &= ~(uint64_t(1) << (I % 64));
// GCC <6.2 crashes if this is written in a single statement.
uint64_t NewBits = Bits[I / 64] & ~(uint64_t(1) << (I % 64));
Bits[I / 64] = NewBits;
return *this;
}
constexpr FeatureBitset &flip(unsigned I) {
Bits[I / 64] ^= uint64_t(1) << (I % 64);
// GCC <6.2 crashes if this is written in a single statement.
uint64_t NewBits = Bits[I / 64] ^ (uint64_t(1) << (I % 64));
Bits[I / 64] = NewBits;
return *this;
}