Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: condition in for loop body is incorrectly optimised away [1.17 backport] #53617

Closed
gopherbot opened this issue Jun 29, 2022 · 3 comments
Labels
CherryPickApproved Used during the release process for point releases
Milestone

Comments

@gopherbot
Copy link

gopherbot commented Jun 29, 2022

@randall77 requested issue #53600 to be considered for backport to the next 1.17 minor release.

@gopherbot please open backport issues for 1.17 and 1.18.

This is a rare bug but results in miscompilation of loops with termination conditions "<= C" for large C.

@gopherbot gopherbot added the CherryPickCandidate Used during the release process for point releases label Jun 29, 2022
@gopherbot gopherbot added this to the Go1.17.12 milestone Jun 29, 2022
@gopherbot
Copy link
Author

gopherbot commented Jun 30, 2022

Change https://go.dev/cl/415415 mentions this issue: [release-branch.go1.17] cmd/compile: fix prove pass when upper condition is <= maxint

@toothrot toothrot added the CherryPickApproved Used during the release process for point releases label Jul 6, 2022
@toothrot
Copy link
Contributor

toothrot commented Jul 6, 2022

Approved. This is a serious issue with no workaround.

@gopherbot gopherbot removed the CherryPickCandidate Used during the release process for point releases label Jul 6, 2022
@gopherbot gopherbot modified the milestones: Go1.17.12, Go1.17.13 Jul 12, 2022
@gopherbot
Copy link
Author

gopherbot commented Jul 25, 2022

Closed by merging 489c148 to release-branch.go1.17.

gopherbot pushed a commit that referenced this issue Jul 25, 2022
…ion is <= maxint

When the terminating condition is <= X, we need to make sure that
X+step doesn't overflow.

Fixes #53617

Change-Id: I36e5384d05b4d7168e48db6094200fcae409bfe5
Reviewed-on: https://go-review.googlesource.com/c/go/+/415219
Reviewed-by: Than McIntosh <thanm@google.com>
Run-TryBot: David Chase <drchase@google.com>
Reviewed-by: David Chase <drchase@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Keith Randall <khr@golang.org>
(cherry picked from commit 31b8c23)
Reviewed-on: https://go-review.googlesource.com/c/go/+/415415
Reviewed-by: Keith Randall <khr@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CherryPickApproved Used during the release process for point releases
Projects
None yet
Development

No branches or pull requests

2 participants