Bug 19632 – [SIMD] Error: invalid foreach aggregate

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-01-29T22:04:05Z
Last change time
2020-12-29T10:40:08Z
Keywords
pull, SIMD
Assigned to
No Owner
Creator
Iain Buclaw

Comments

Comment #0 by ibuclaw — 2019-01-29T22:04:05Z
int doubleAndSumInt(int4 v) { int sum = 0; foreach (ref e; v) sum += (e *= 2); return sum; }
Comment #1 by uplink.coder — 2019-01-30T00:11:56Z
Ah yes. I know about this one ;) I don't think it's important ... throw a -vcg-ast at it and you will see why it fails.
Comment #2 by bugzilla — 2020-12-28T09:37:05Z
Replacing the v in the foreach with v.array will enable it to work. It's not documented to work without the .array, so I'm setting this as an enhancement request.
Comment #3 by dlang-bot — 2020-12-29T09:54:11Z
@WalterBright created dlang/dmd pull request #12065 "fix Issue 19632 - [SIMD] Error: invalid foreach aggregate" fixing this issue: - fix Issue 19632 - [SIMD] Error: invalid foreach aggregate https://github.com/dlang/dmd/pull/12065
Comment #4 by dlang-bot — 2020-12-29T10:40:08Z
dlang/dmd pull request #12065 "fix Issue 19632 - [SIMD] Error: invalid foreach aggregate" was merged into master: - cbb2d8f9a7eeadbd143d8ab4953c849c7e59454a by Walter Bright: fix Issue 19632 - [SIMD] Error: invalid foreach aggregate https://github.com/dlang/dmd/pull/12065