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

remove redundant assignments in generated function bodies #19036

Merged
merged 1 commit into from
Oct 20, 2016
Merged

Conversation

JeffBezanson
Copy link
Member

This was causing us to emit a copy+assignment for each argument of a generated function, x=x; y=y; .... It doesn't really matter, except when one of these functions is compiled without optimizations, causing us to access and assign a variable that the front end thought was unused.

@JeffBezanson JeffBezanson added compiler:lowering Syntax lowering (compiler front end, 2nd stage) bugfix This change fixes an existing bug labels Oct 20, 2016
@tkelman
Copy link
Contributor

tkelman commented Oct 20, 2016

test case?

@JeffBezanson
Copy link
Member Author

I was only able to trigger this with type inference disabled. Even then, it's hard to say what to test, since there isn't really anything wrong with redundant assignment statements. It would be good to run the tests with inference off every now and then, but due to return_type that probably isn't possible.

@vtjnash vtjnash merged commit ec32d7f into master Oct 20, 2016
@vtjnash vtjnash deleted the jb/fixundef branch October 20, 2016 15:39
@StefanKarpinski
Copy link
Member

It would be good to run the tests with inference off every now and then, but due to return_type that probably isn't possible.

If the number of tests that require return_type is not too large, they could be fenced off with

if Sys.inferece_enabled
    @test ...
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug compiler:lowering Syntax lowering (compiler front end, 2nd stage)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants