D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21214 - simd: wrong diagnostic with unsupported vectors
Summary: simd: wrong diagnostic with unsupported vectors
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: diagnostic, pull, SIMD
Depends on:
Blocks:
 
Reported: 2020-09-02 09:32 UTC by Iain Buclaw
Modified: 2020-12-23 03:17 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Iain Buclaw 2020-09-02 09:32:07 UTC
__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 Walter Bright 2020-12-21 09:35:48 UTC
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 Iain Buclaw 2020-12-21 11:34:45 UTC
(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 Dlang Bot 2020-12-22 03:15:35 UTC
@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 Dlang Bot 2020-12-23 03:17:20 UTC
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