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 3822 - Invalid optimization of alloca called with constant size #707

Merged
merged 1 commit into from
Feb 19, 2012

Conversation

yebblies
Copy link
Member

e2ir.c constains an optimization to turn alloca into a fixed sized array allocation on the stack when alloca is called with a compile-time constant. This is invalid as alloca may be called inside a loop.

I think the correct place to perform this optimization is in the backend, where analysis can determine alloca is called at most once per function call and turn it into a local variable allocation.

http://d.puremagic.com/issues/show_bug.cgi?id=3822

e2ir.c constains an optimization to turn alloca into a fixed sized array allocation on the stack when alloca is called with a compile-time constant.  This is invalid as alloca may be called inside a loop.
WalterBright added a commit that referenced this pull request Feb 19, 2012
Issue 3822 - Invalid optimization of alloca called with constant size
@WalterBright WalterBright merged commit 3fc9ee7 into dlang:master Feb 19, 2012
braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
Switch std.algorithm/.range to lambda syntax
braddr pushed a commit to braddr/dmd that referenced this pull request Oct 22, 2012
Because of the auto-tester breaking.

This reverts commit d5319fc, reversing
changes made to 5313288.
@yebblies yebblies deleted the issue3822 branch February 15, 2014 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants