Commit 70106db9 by Iain Buclaw

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
parent e7c6715e
420cce2a654f14b8de4a75cbb5d4203fce8d4e0f f30c5dc790c17914463879157447acc671518735
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository. merge done from the dlang/dmd repository.
...@@ -278,7 +278,7 @@ IntRange IntRange::fromType(Type *type) ...@@ -278,7 +278,7 @@ IntRange IntRange::fromType(Type *type)
IntRange IntRange::fromType(Type *type, bool isUnsigned) IntRange IntRange::fromType(Type *type, bool isUnsigned)
{ {
if (!type->isintegral()) if (!type->isintegral() || type->toBasetype()->ty == Tvector)
return widest(); return widest();
uinteger_t mask = type->sizemask(); uinteger_t mask = type->sizemask();
...@@ -404,7 +404,7 @@ IntRange& IntRange::castDchar() ...@@ -404,7 +404,7 @@ IntRange& IntRange::castDchar()
IntRange& IntRange::cast(Type *type) IntRange& IntRange::cast(Type *type)
{ {
if (!type->isintegral()) if (!type->isintegral() || type->toBasetype()->ty == Tvector)
return *this; return *this;
else if (!type->isunsigned()) else if (!type->isunsigned())
return castSigned(type->sizemask()); return castSigned(type->sizemask());
...@@ -416,7 +416,7 @@ IntRange& IntRange::cast(Type *type) ...@@ -416,7 +416,7 @@ IntRange& IntRange::cast(Type *type)
IntRange& IntRange::castUnsigned(Type *type) IntRange& IntRange::castUnsigned(Type *type)
{ {
if (!type->isintegral()) if (!type->isintegral() || type->toBasetype()->ty == Tvector)
return castUnsigned(UINT64_MAX); return castUnsigned(UINT64_MAX);
else if (type->toBasetype()->ty == Tdchar) else if (type->toBasetype()->ty == Tdchar)
return castDchar(); return castDchar();
......
/*
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;
}
/*
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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment