[mlir] split type conversion to two lines for GCC's sake
authorTres Popp <tpopp@google.com>
Mon, 26 Jul 2021 12:15:37 +0000 (14:15 +0200)
committerTres Popp <tpopp@google.com>
Mon, 26 Jul 2021 12:15:47 +0000 (14:15 +0200)
mlir/lib/Transforms/BufferDeallocation.cpp

index 43d654e..65a5493 100644 (file)
@@ -394,7 +394,10 @@ private:
         auto terminatorOperands = *getMutableRegionBranchSuccessorOperands(
             terminator, region.getRegionNumber());
         // Extract the source value from the current terminator.
-        Value sourceValue = ((OperandRange)terminatorOperands)[operandIndex];
+        // This conversion needs to exist on a separate line due to a bug in
+        // GCC conversion analysis.
+        OperandRange immutableTerminatorOperands = terminatorOperands;
+        Value sourceValue = immutableTerminatorOperands[operandIndex];
         // Create a new clone at the current location of the terminator.
         Value clone = introduceCloneBuffers(sourceValue, terminator);
         // Wire clone and terminator operand.