D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11717 - CTFE: non-constant value with array and vector ops.
Summary: CTFE: non-constant value with array and vector ops.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 critical
Assignee: No Owner
URL:
Keywords: CTFE, pull, rejects-valid, SIMD
: 12401 (view as issue list)
Depends on:
Blocks:
 
Reported: 2013-12-10 04:47 UTC by Iain Buclaw
Modified: 2021-01-02 07:58 UTC (History)
4 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 2013-12-10 04:47:10 UTC
Currently, trying to do array/vector operations in CTFE causes an ICE.

Tests:
---
enum int[4] A = [1,2,3,4];
enum int[4] B = [1,2,3,4];
// Internal Compiler Error: non-constant value [1, 2, 3, 4]
enum int[4] C = A[] + B[];

import core.simd;
enum int4 D = [1,2,3,4];
enum int4 E = [1,2,3,4];
// Internal Compiler Error: non-constant value [1, 2, 3, 4]
enum int4 F = D + E;
Comment 1 John Colvin 2014-12-18 22:56:42 UTC
*** Issue 12401 has been marked as a duplicate of this issue. ***
Comment 2 Walter Bright 2016-04-25 09:17:46 UTC
Add a proper error message at least:

https://github.com/dlang/dmd/pull/5706

until a fix can be devised.
Comment 3 github-bugzilla 2016-04-25 18:51:12 UTC
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/f571e8a3ee9d460152e43a08dabf96d5ed5d72d9
add error message for Issue 11717 - CTFE: [ICE] non-constant value with array and vector ops

https://github.com/dlang/dmd/commit/0a9712f66c2658756f2d69b463e1879c24b3a80c
Merge pull request #5706 from WalterBright/address11717

add error message for Issue 11717 - CTFE: [ICE] non-constant value wi…
Comment 4 github-bugzilla 2016-10-01 11:46:32 UTC
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/f571e8a3ee9d460152e43a08dabf96d5ed5d72d9
add error message for Issue 11717 - CTFE: [ICE] non-constant value with array and vector ops

https://github.com/dlang/dmd/commit/0a9712f66c2658756f2d69b463e1879c24b3a80c
Merge pull request #5706 from WalterBright/address11717
Comment 5 github-bugzilla 2017-08-02 08:07:24 UTC
Commit pushed to dmd-cxx at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/5ab26bb7e0dfc0039e80a9bc9d4120af15e18a2f
Add error message for Issue 11717
Comment 6 basile-z 2019-07-11 00:31:31 UTC
ICE are gone since 2.072
Comment 7 Iain Buclaw 2019-07-11 04:51:00 UTC
Replacing an ICE with an error is not a fix.

Updating tags from ice to rejects-valid.
Comment 8 basile-z 2019-07-11 07:05:35 UTC
You should change the title as well. (this is why I closed : the issue was about the ICE. Change the title and it's a complete different thing)
Comment 9 Dlang Bot 2020-12-31 10:24:10 UTC
@WalterBright created dlang/dmd pull request #12083 "fix Issue 11717 - CTFE: non-constant value with array and vector ops" fixing this issue:

- fix Issue 11717 - CTFE: non-constant value with array and vector ops

https://github.com/dlang/dmd/pull/12083
Comment 10 Dlang Bot 2021-01-02 07:58:51 UTC
dlang/dmd pull request #12083 "fix Issue 11717 - CTFE: non-constant value with array and vector ops" was merged into master:

- 6a958967ccc8261d2095625492e27f22e1078b0b by Walter Bright:
  fix Issue 11717 - CTFE: non-constant value with array and vector ops

https://github.com/dlang/dmd/pull/12083