From: Iain Buclaw Date: Sun, 16 Jun 2019 07:48:42 +0000 (+0000) Subject: re PR d/90604 (ICE in sizemask, at d/dmd/mtype.c:2542) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=70106db92654b83cd0ea62a078805e84ef2d8ee8;p=gcc.git re PR d/90604 (ICE in sizemask, at d/dmd/mtype.c:2542) PR d/90604 d/dmd: Merge upstream dmd f30c5dc79 Fixes internal compiler error in Type::sizemask. Reviewed-on: https://github.com/dlang/dmd/pull/9998 From-SVN: r272343 --- diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE index 7456d604a91..4cb2bbac46d 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 940385ccf7e..e0e2472b502 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 00000000000..406e468ca00 --- /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 00000000000..0b47fb78944 --- /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; +} +