Bug 21214 – simd: wrong diagnostic with unsupported vectors
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-09-02T09:32:07Z
Last change time
2020-12-23T03:17:20Z
Keywords
diagnostic, pull, SIMD
Assigned to
No Owner
Creator
Iain Buclaw
Comments
Comment #0 by ibuclaw — 2020-09-02T09:32:07Z
__vector(__vector(int[2])[2]) v2x2;
__vector(__vector(int[2])[4]) v2x4;
__vector(__vector(int[4])[2]) v4x2;
__vector(__vector(int[4])[4]) v4x4;
The given test above yields the following errors:
test.d(1): Error: 8 byte vector type __vector(int[2]) is not supported on this platform
test.d(1): Error: 8 byte vector type __vector(int[2]) is not supported on this platform
test.d(2): Error: 8 byte vector type __vector(int[2]) is not supported on this platform
test.d(2): Error: 8 byte vector type __vector(int[2]) is not supported on this platform
test.d(3): Error: vector type __vector(__vector(int[4])[2]) is not supported on this platform
test.d(4): Error: vector type __vector(__vector(int[4])[4]) is not supported on this platform
Instead, they should all produce an error like line 3 and 4.
Comment #1 by bugzilla — 2020-12-21T09:35:48Z
I don't understand. The diagnostics all look correct to me. The semantics are done bottom up and stop at the first error.
Comment #2 by ibuclaw — 2020-12-21T11:34:45Z
(In reply to Walter Bright from comment #1)
> I don't understand. The diagnostics all look correct to me. The semantics
> are done bottom up and stop at the first error.
The error occurs twice:
test.d(1): Error: 8 byte vector type __vector(int[2]) is not supported on this platform
test.d(1): Error: 8 byte vector type __vector(int[2]) is not supported on this platform
The second error is wrong, as the basetype of the outer vector is not `int[2]`.
A more accurate diagnostic would be:
test.d(1): Error: 8 byte vector type __vector(int[2]) is not supported on this platform
test.d(1): Error: vector type __vector(__vector(int[2])[2]) is not supported on this platform
Comment #3 by dlang-bot — 2020-12-22T03:15:35Z
@WalterBright created dlang/dmd pull request #12044 "fix Issue 21214 - simd: wrong diagnostic with unsupported vectors" fixing this issue:
- fix Issue 21214 - simd: wrong diagnostic with unsupported vectors
https://github.com/dlang/dmd/pull/12044
Comment #4 by dlang-bot — 2020-12-23T03:17:20Z
dlang/dmd pull request #12044 "fix Issue 21214 - simd: wrong diagnostic with unsupported vectors" was merged into master:
- 0303ef963aee809888c85d446fc0177f432445b0 by Walter Bright:
fix Issue 21214 - simd: wrong diagnostic with unsupported vectors
https://github.com/dlang/dmd/pull/12044