-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Bounds checking fails to compile in 16-bit mode (MSP430) #2520
Comments
Sounds reasonable. With a debugger, try outputting |
Just a debugging trick which might or might not be applicable here: Did you try |
@klickverbot No, I didn't try it. My knowledge of LLVM is somewhat limited ATM, so those kind of suggestions help. I'll try that and @kinke's suggestion, and get back to you as soon as I find the time. |
One interesting thing is that the bug happens even when k is a
I don't understand why calling toChars() in the index->type doesn't result in a string though:
|
Hmm, that's D code, maybe give gdb a shot? Another useful debugging tool is running ldc with the |
Using I'll submit a pull request using |
I'm currently playing with LDC on AVR. Bumped into this issue and did a bit of experimentation, gaining some insight. Since D is designed for 32-bit architectures and up, it'd probably be painful to have This is not by the book, since So all fine so far. Where this falls flat is that the frontend and backend are in disagreement about the type of the integer. If you execute Thus the fix would be that when a pointer is used as a integer, backend code should automatically be generated to widen the integer to 32 bits at the backend. |
The following code, when compiled with bounds checking on, fails to compile for
-mtriple=msp430
:I looked around. I guess the problem will be here:
DtoArrayLen
eventually leads to the changes I made tosize_t
in LDC for the MSP430, so I'm leaning towards the issue being with index not being of the proper type, but I'm a bit lost in the weeds here, so any help would be appreciated.The text was updated successfully, but these errors were encountered: