Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SSA Transform relies on initializers to create intial name on stack #16

Open
Labels
@dibyendumajumdar

Description

This snippet fails:

 func foo(x: Int) {
 var z: Int
 while (x > 0) {
 z = 5
 if (x == 1)
 z = z+1
 x = x - 1
 }
 }

While this is okay

 func foo(x: Int) {
 var z = 0
 while (x > 0) {
 z = 5
 if (x == 1)
 z = z+1
 x = x - 1
 }
 }

The problem seems to be in 2nd block of search() where we look for instructions of form v = x op y. The declaration alone does not generate such an instruction.

Potential solution may be that declaration of a var generates a var instruction that defines the var.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /