Skip to content

Commit cd7e003

Browse files
jwakelyigcbot
authored andcommitted
Fix compilation error with GCC 12
This hits a bug in unreleased GCC 12 snapshots, due to an ambiguous std::pair constructor. It can be easily avoided and improve the code at the same time, by using nullptr for the pointer, and using emplace to avoid an unnecessary temporary.
1 parent ebbe57e commit cd7e003

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

IGC/VectorCompiler/lib/GenXCodeGen/GenXLiveness.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ void GenXLiveness::replaceValue(SimpleValue OldVal, SimpleValue NewVal)
587587
*/
588588
LiveRange *GenXLiveness::getOrCreateLiveRange(SimpleValue V)
589589
{
590-
auto [i, isInserted] = LiveRangeMap.insert(LiveRangeMap_t::value_type(V, 0));
590+
auto [i, isInserted] = LiveRangeMap.emplace(V, nullptr);
591591
LLVM_DEBUG(dbgs() << "getOrCreateLiveRange for SimpleValue: " << V << " "
592592
<< (isInserted ? "Inserted" : "Not inserted") << "\n");
593593
LiveRange *LR = i->second;

0 commit comments

Comments
 (0)