D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13357 - [ICE] Segfault on comparison of rvalue __vector and array
Summary: [ICE] Segfault on comparison of rvalue __vector and array
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: SIMD
Depends on:
Blocks:
 
Reported: 2014-08-22 14:16 UTC by Alexey Prokhin
Modified: 2020-03-21 03:56 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 Alexey Prokhin 2014-08-22 14:16:07 UTC
alias __vector(float[4]) float4;

void main() {    
    float4 a = 1, b = 2;
    
    // 2.065: segfault
    // 2.066: Error: cannot compare float[4] and int[]
    assert((a + b).array == [3, 3, 3, 3]); 
    
    // segfault on both 2.065 and 2.066
    assert((a + b).array == [3.0f, 3.0f, 3.0f, 3.0f]);
}

The code works with ldc, however I had to revert changes to TypeVector::dotExp() from https://github.com/D-Programming-Language/dmd/pull/3467
Comment 1 John Colvin 2014-12-18 22:16:01 UTC
Just an update to say that this still affects git HEAD, with exactly the same errors as 2.066

Bugs like this make SIMD in D a complete pain. C with gcc or icc is better to use.
Comment 2 Walter Bright 2016-11-22 01:28:38 UTC
At least it doesn't seg fault anymore.