-
-
Notifications
You must be signed in to change notification settings - Fork 613
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
Replace call to runtime hook _d_arraycast with call to template object.__ArrayCast - Take 2 #9516
Conversation
Thanks for your pull request and interest in making D better, @JinShil! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#9516" |
Ok, that gave me a little more information:
Anyone have any ideas? |
cc @UplinkCoder |
This is deliberate. CTFE cannot assume data-layout at runtime and at ctfe will be the same. |
Tests? |
This is just replacing the runtime hook If this is merged, a followup PR will be made to druntime to remove the This does have the potential side effect of making the array cast feature available to betterC. However, trying to tackle that simultaneously with just getting this working is taking on a little too much at a time. I'm changing my strategy to just do a direct translation of the runtime hook, modify DMD to call it, and then follow up with additional PRs to make the feature work in betterC. At that time, I can add the betterC tests. |
We had problems in the past with incorrect runtime hooks being called #9481. But I guess once |
OK, I'm pretty happy with this, and I've increased my understanding of how all of this works. Please understand the scope of the PR. We're trying to replace the runtime hooks with templates. Please see https://forum.dlang.org/post/[email protected] for justification. I can see now that we could actually improve Once this is merged I'll submit a PR to druntime to remove This is ready to go, assuming it passes the test suite. |
…t.__ArrayCast - Take 2
Sorry for the interruption. I just realized that since I added the |
This introduced a regression: https://issues.dlang.org/show_bug.cgi?id=19840 |
This commit causes a new ICE : https://issues.dlang.org/show_bug.cgi?id=19954 |
This new ICE happens because during semantic |
Why is the size changed to 16? |
I don't know. 16 is the size of an array as a fat pointer but nextof in both case is well used... Look at the new test case. Something is seriously broken with string literals (array literals containing |
@JinShil please revert this until you find the problem. |
@WalterBright, it has already been released and reverting it would also require reverting the druntime PR that accompanied it. Please give me a couple of days to figure it out. |
Are you on the fix @JinShil ? I said earlier that I would have a fix but actually I don't. There are several ways to fix the two new test cases but then either
So I give up. You'll probably handle this in a smarter way. |
I'm working on it and have run into the same issues in template9.d and foreach4.d. It appears we may need to special-case array literals and/or string literals (e.g. |
Valid casts are not broken. Maybe to disallow casting between arrays of different count of dimension would work. |
I'm still waiting on the test suite, but I think I have a fix at #10036 |
An attempt to finish up #8531 and set an example for a GSoC project.
This is a WIP. CTFE is currently running out of memory on my machine (6GB RAM) when importingstd.uni
. I want to see how it does on the test suite.