diff options
Diffstat (limited to 'src/cmd/compile/internal')
| -rw-r--r-- | src/cmd/compile/internal/ssa/loopbce.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/loopbce.go b/src/cmd/compile/internal/ssa/loopbce.go index 0d3130fe9a..127018dfb0 100644 --- a/src/cmd/compile/internal/ssa/loopbce.go +++ b/src/cmd/compile/internal/ssa/loopbce.go @@ -159,6 +159,12 @@ nextblock: if step == 0 { continue } + // step == minInt64 cannot be safely negated below, because -step + // overflows back to minInt64. The later underflow checks need a + // positive magnitude, so reject this case here. + if step == minSignedValue(ind.Type) { + continue + } // startBody is the edge that eventually returns to the loop header. var startBody Edge |
