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

dev.ssa: opt pass doesn't correctly mark dead code #11676

Closed
randall77 opened this issue Jul 11, 2015 · 2 comments
Closed

dev.ssa: opt pass doesn't correctly mark dead code #11676

randall77 opened this issue Jul 11, 2015 · 2 comments
Milestone

Comments

@randall77
Copy link
Contributor

package main

var x int

func f_ssa() {
    if true {
        return
    }
    for i := 0; i < 5; i++ {
        x = 5
    }
}

The loop block is dead. The opt pass, which detects that the loop is dead, doesn't completely fix up the ssa graph, the exit block still has a phi with an argument from the dead code. This causes deadcode to barf on it.

@josharian @bradfitz

@randall77 randall77 self-assigned this Jul 11, 2015
@randall77 randall77 added this to the Go1.6 milestone Jul 11, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/12091 mentions this issue.

gopherbot pushed a commit that referenced this issue Jul 11, 2015
…ot live

Fixes #11676

Change-Id: I941f951633c89bb1454ce6d1d1b4124d46a7d9dd
Reviewed-on: https://go-review.googlesource.com/12091
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@josharian
Copy link
Contributor

Fixed by CL 12091.

@golang golang locked and limited conversation to collaborators Aug 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants