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

Issue 13427 - [REG2.066] cannot inline default argument alloca(...) #3961

Merged
merged 1 commit into from
Sep 7, 2014

Conversation

yebblies
Copy link
Member

@yebblies yebblies commented Sep 7, 2014

Apart from inlining, inlineCost is also used for default argument copying. When using it from there, don't block inlining of alloca.

https://issues.dlang.org/show_bug.cgi?id=13427

@yebblies yebblies added the Severity:Regression PRs that fix regressions label Sep 7, 2014
@mleise
Copy link
Contributor

mleise commented Sep 7, 2014

Thank you, yebblies! I will give it a try.

@mleise
Copy link
Contributor

mleise commented Sep 7, 2014

The regression is fixed and the function in question also gets inlined correctly so long it doesn't use alloca() internally. LGTM.
By the way: Does this bug mean that DMD generally counts default parameter expressions towards the inlining cost although they will end up on the caller side either way or was alloca() just a special case?

@yebblies
Copy link
Member Author

yebblies commented Sep 7, 2014

DMD uses the inliner to copy default arguments into the caller's scope, which makes sure any contained declarations get updated correctly to prevent conflicts. It's done in a different invocation to the actual inlining of the function, so it won't affect inline-ability of the call.

@WalterBright
Copy link
Member

Auto-merge toggled on

WalterBright added a commit that referenced this pull request Sep 7, 2014
Issue 13427 - [REG2.066] cannot inline default argument alloca(...)
@WalterBright WalterBright merged commit 0c20be0 into dlang:master Sep 7, 2014
@yebblies yebblies deleted the issue13427 branch September 7, 2014 18:37
@yebblies
Copy link
Member Author

yebblies commented Sep 7, 2014

Thanks!

dnadlinger pushed a commit to dnadlinger/dmd that referenced this pull request Sep 14, 2014
Issue 13427 - [REG2.066] cannot inline default argument alloca(...)
9rnsr added a commit that referenced this pull request Sep 14, 2014
Cherry-picking pull request #3961 for 2.066.1
9rnsr added a commit that referenced this pull request Sep 18, 2014
Cherry-picking pull request #3961 for 2.066.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity:Regression PRs that fix regressions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants