diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2019-08-24 16:19:32 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2019-08-24 16:19:32 +0000 |
commit | aa5ef3887c0ed66e271ee00fc0cf2b1ead766b1c (patch) | |
tree | c49ce830f06dfc9301bb8bb0a917cf3955508d3c | |
parent | 7e8f9d579ccb8e473855cb466bd77c89fada1483 (diff) | |
download | bcm5719-llvm-aa5ef3887c0ed66e271ee00fc0cf2b1ead766b1c.tar.gz bcm5719-llvm-aa5ef3887c0ed66e271ee00fc0cf2b1ead766b1c.zip |
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
-rw-r--r-- | llvm/include/llvm/MC/SubtargetFeature.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/include/llvm/MC/SubtargetFeature.h b/llvm/include/llvm/MC/SubtargetFeature.h index 7ce27843c2c..defbc3c6472 100644 --- a/llvm/include/llvm/MC/SubtargetFeature.h +++ b/llvm/include/llvm/MC/SubtargetFeature.h @@ -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; } |