cmd/compile: go1.11beta1 for loop with multiple conditions goes into infinite loop #26194
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
release-blocker
Milestone
I have produced a minimal example of a bug seen when running under go1.11beta1 which causes for loops to go into an infinite loop when the condition contains multiple statements.
This seems to be due to an over-aggressive compiler optimisation, as the issue does not occur if I run with
-gcflags '-N -l'
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
-gcflags '-N -l'
- noWhat operating system and processor architecture are you using (
go env
)?What did you do?
Run this under both
1.10.2
and1.11beta1
and compare.https://play.golang.org/p/pdNCtWFnsGj
What did you expect to see?
The loop stop on the third iteration.
What did you see instead?
The loop never finishing.
If it's of any use, here's a diff of the generated instructions when building with and without
-gcflags '-N -l'
under go1.11beta1The text was updated successfully, but these errors were encountered: