-
Notifications
You must be signed in to change notification settings - Fork 18
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 with compilation when using arrays of functions, while executing external functions
in the loop assigning the functions (in the array).
#168
Comments
What error messages are you seeing ? I'd like additional informations on your setup to make sure I can reproduce properly. |
Looks like an issue with closure conversion |
Indeed. It's the same thing as: #116 |
I note that mem2reg could also be made a bit stronger, and this would hide the bug in this case by effectively removing the array. But the real bug is that our closure conversion pass is busted and needs a rewrite. I attempted one last year but ended up shelving it because it was based on an experimental branch that ended up being unworkable. |
Seems like you already reproduced it. Here are some infos anyways.
|
Might have two separate issues here. I commented some peculiarities I found while playing around with the code.
Issue description:
Seems like adding an external function messes up the code generation, when arrays of functions are assigned. This also happens for arrays of structs that contain functions.
Issues:
It seems like only the last function that was written to (in an array of functions) can be accessed, when using an external function in the loop.
We also can't use range(...) to write to the function array. We need to use unroll(...).
The following code will not compile in the current configuration:
The text was updated successfully, but these errors were encountered: