Skip to content
This repository has been archived by the owner on Jun 20, 2019. It is now read-only.

Commit

Permalink
Merge pull request #241 from ibuclaw/bug213
Browse files Browse the repository at this point in the history
Bug 213: Fix ICE when comparing two SIMD vectors in a struct
  • Loading branch information
jpf91 authored Sep 17, 2016
2 parents 33b8889 + 6542f6e commit 26d36a5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions gcc/d/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2016-09-16 Iain Buclaw <ibuclaw@gdcproject.org>

* d-codegen.cc (lower_struct_comparison): Don't compare vectors in the
same way as integers.

2016-09-11 Iain Buclaw <ibuclaw@gdcproject.org>

* d-todt.cc (Type::toDt): Remove function, inline into callers.
Expand Down
2 changes: 1 addition & 1 deletion gcc/d/d-codegen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ lower_struct_comparison(tree_code code, StructDeclaration *sd, tree t1, tree t2)
tree stype = build_ctype(vd->type);
machine_mode mode = int_mode_for_mode(TYPE_MODE (stype));

if (vd->type->isintegral())
if (vd->type->ty != Tvector && vd->type->isintegral())
{
// Integer comparison, no special handling required.
tcmp = build_boolop(code, t1ref, t2ref);
Expand Down
13 changes: 13 additions & 0 deletions gcc/testsuite/gdc.test/compilable/gdc213.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import core.simd;

struct S213
{
int4 vec;
}

void test213()
{
S213 s, b;

assert(s == b);
}

0 comments on commit 26d36a5

Please sign in to comment.