Bug 19561 – Enable array assignment & array ops in betterC

Status
RESOLVED
Resolution
WORKSFORME
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-01-09T02:12:32Z
Last change time
2023-01-15T06:23:05Z
Keywords
betterC
Assigned to
No Owner
Creator
Nathan S.
See also
https://issues.dlang.org/show_bug.cgi?id=19234, https://issues.dlang.org/show_bug.cgi?id=19268, https://issues.dlang.org/show_bug.cgi?id=19946

Comments

Comment #0 by n8sh.secondary — 2019-01-09T02:12:32Z
Assigning an array slice to another array slice works in betterC since https://github.com/dlang/dmd/pull/7867 but other array operations do not. Example of non-working code: --- version (D_BetterC) extern(C) void main() { int[3] a, b; a[] = 0; // Works. a[] = b[]; // Works. a[] = 1; // error: undefined reference to '_memset32' a[] += 1; // Error: TypeInfo cannot be used with -betterC a[] += b[]; // Error: TypeInfo cannot be used with -betterC } ---
Comment #1 by n8sh.secondary — 2019-06-01T19:52:33Z
*** Issue 19753 has been marked as a duplicate of this issue. ***
Comment #2 by n8sh.secondary — 2019-06-01T19:55:37Z
The failure seems to be due to #19268 triggered in _arrayOps!Args.
Comment #3 by dlang-bot — 2019-06-02T05:01:16Z
dlang/druntime pull request #2622 "Issue 19561 - Enable array ops in betterC" was merged into master: - c596b30147c762ba853948a76ca942c1456212f0 by Nathan Sashihara: Issue 19561 - Enable array ops in betterC Known limitation: slice assignment to a scalar won't work in betterC for types of size other than 1 because the compiler will try to use _memset16/_memset32/etc. This can only be addressed in DMD rather than druntime. https://github.com/dlang/druntime/pull/2622
Comment #4 by bugzilla — 2023-01-15T06:14:17Z
The `a[] = 1;` case was handled by https://github.com/dlang/dmd/pull/14770
Comment #5 by bugzilla — 2023-01-15T06:23:05Z
It's working now.