aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/d/dmd/MERGE2
-rw-r--r--gcc/d/dmd/intrange.c6
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fail19898a.d14
-rw-r--r--gcc/testsuite/gdc.test/fail_compilation/fail19898b.d21
4 files changed, 39 insertions, 4 deletions
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index 7456d60..4cb2bba 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -1,4 +1,4 @@
-420cce2a654f14b8de4a75cbb5d4203fce8d4e0f
+f30c5dc790c17914463879157447acc671518735
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
diff --git a/gcc/d/dmd/intrange.c b/gcc/d/dmd/intrange.c
index 940385c..e0e2472 100644
--- a/gcc/d/dmd/intrange.c
+++ b/gcc/d/dmd/intrange.c
@@ -278,7 +278,7 @@ IntRange IntRange::fromType(Type *type)
IntRange IntRange::fromType(Type *type, bool isUnsigned)
{
- if (!type->isintegral())
+ if (!type->isintegral() || type->toBasetype()->ty == Tvector)
return widest();
uinteger_t mask = type->sizemask();
@@ -404,7 +404,7 @@ IntRange& IntRange::castDchar()
IntRange& IntRange::cast(Type *type)
{
- if (!type->isintegral())
+ if (!type->isintegral() || type->toBasetype()->ty == Tvector)
return *this;
else if (!type->isunsigned())
return castSigned(type->sizemask());
@@ -416,7 +416,7 @@ IntRange& IntRange::cast(Type *type)
IntRange& IntRange::castUnsigned(Type *type)
{
- if (!type->isintegral())
+ if (!type->isintegral() || type->toBasetype()->ty == Tvector)
return castUnsigned(UINT64_MAX);
else if (type->toBasetype()->ty == Tdchar)
return castDchar();
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19898a.d b/gcc/testsuite/gdc.test/fail_compilation/fail19898a.d
new file mode 100644
index 0000000..406e468
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail19898a.d
@@ -0,0 +1,14 @@
+/*
+PERMUTE_ARGS:
+REQUIRED_ARGS: -m64
+TEST_OUTPUT:
+---
+fail_compilation/fail19898a.d(11): Error: incompatible types for `(__key2) < (__limit3)`: both operands are of type `__vector(int[4])`
+---
+*/
+void f (__vector(int[4]) n)
+{
+ foreach (i; 0 .. n)
+ cast(void)n;
+}
+
diff --git a/gcc/testsuite/gdc.test/fail_compilation/fail19898b.d b/gcc/testsuite/gdc.test/fail_compilation/fail19898b.d
new file mode 100644
index 0000000..0b47fb78
--- /dev/null
+++ b/gcc/testsuite/gdc.test/fail_compilation/fail19898b.d
@@ -0,0 +1,21 @@
+/*
+PERMUTE_ARGS:
+REQUIRED_ARGS: -m64
+TEST_OUTPUT:
+---
+fail_compilation/fail19898b.d(18): Error: cannot implicitly convert expression `m` of type `S` to `__vector(int[4])`
+fail_compilation/fail19898b.d(18): Error: incompatible types for `(__key2) != (__limit3)`: both operands are of type `__vector(int[4])`
+fail_compilation/fail19898b.d(18): Error: cannot cast expression `__key2` of type `__vector(int[4])` to `S`
+---
+*/
+struct S
+{
+ int a;
+}
+
+void f (__vector(int[4]) n, S m)
+{
+ foreach (i; m .. n)
+ cast(void)n;
+}
+