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

fix #14165 #18739 #18791

Closed
wants to merge 23 commits into from
Closed

fix #14165 #18739 #18791

wants to merge 23 commits into from

Conversation

ringabout
Copy link
Member

@ringabout ringabout commented Sep 3, 2021

fix the second example of #6269
fixes #14165
fixes #18739

@ringabout ringabout changed the title fix #6269 #14165 #18739 fix #14165 #18739 Sep 3, 2021
@@ -734,7 +734,7 @@ proc transformFor(c: PTransf, n: PNode): PNode =
stmtList.add(newAsgnStmt(c, nkFastAsgn, temp, arg))
idNodeTablePut(newC.mapping, formal, temp)

let body = transformBody(c.graph, c.idgen, iter, true)
let body = transformBody(c.graph, c.idgen, iter, true).copyTree
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seem expensive and worse, weird. How come for example that not a fresh set of local variables is required?

Copy link
Member Author

@ringabout ringabout Sep 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a regression: b1ff37c

Ref #14165 (comment)

Copy link
Member Author

@ringabout ringabout Sep 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before 0.20.0, copyTree is used.Then the optimization may remove it wrongly.
copyTree is introduced in here: 5432b2b#diff-c7b80f51fb685eb22c5b56ee2f320d6c708706f3ae7293478ecd104a2b5b8096

@Araq Araq added this to the 1.6.0 milestone Sep 4, 2021
@Araq
Copy link
Member

Araq commented Sep 6, 2021

Alternative is here #18812

@Araq Araq removed this from the 1.6.0 milestone Sep 6, 2021
@ringabout ringabout closed this Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants