This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH, PR d/90445] Committed fix for ICE in d_build_c_type_nodes, at d/d-builtins.cc:783
- From: Iain Buclaw <ibuclaw at gdcproject dot org>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 21 Aug 2019 09:57:00 +0200
- Subject: [PATCH, PR d/90445] Committed fix for ICE in d_build_c_type_nodes, at d/d-builtins.cc:783
Hi,
This patch fixes another ICE in the D front-end that occurred on
targets where SIZE_TYPE was unhandled by d_build_c_type_nodes.
Now signed_type_for() is used to set signed_size_type_node, and
(u)intmax_type_node is determined by UINTMAX_TYPE.
Bootstrapped and regression tested the D testsuite on
x86_64-linux-gnu, with further checking done on cross-compiler targets
mips64vr-elf, msp430-elf, pdp11-aout, and visium-elf to verify the ICE
no longer persists.
Committed to trunk as r274766.
--
Iain
---
gcc/d/ChangeLog:
PR d/90445
* d-builtins.cc (d_build_c_type_nodes): Test UINTMAX_TYPE for setting
uintmax_type_node. Set signed_size_type_node as the signed_type_for
size_type_node.
---
diff --git a/gcc/d/d-builtins.cc b/gcc/d/d-builtins.cc
index 845f6a3d586..c90fc9051d9 100644
--- a/gcc/d/d-builtins.cc
+++ b/gcc/d/d-builtins.cc
@@ -762,27 +762,25 @@ d_build_c_type_nodes (void)
= build_pointer_type (build_qualified_type (char_type_node,
TYPE_QUAL_CONST));
- if (strcmp (SIZE_TYPE, "unsigned int") == 0)
+ if (strcmp (UINTMAX_TYPE, "unsigned int") == 0)
{
intmax_type_node = integer_type_node;
uintmax_type_node = unsigned_type_node;
- signed_size_type_node = integer_type_node;
}
- else if (strcmp (SIZE_TYPE, "long unsigned int") == 0)
+ else if (strcmp (UINTMAX_TYPE, "long unsigned int") == 0)
{
intmax_type_node = long_integer_type_node;
uintmax_type_node = long_unsigned_type_node;
- signed_size_type_node = long_integer_type_node;
}
- else if (strcmp (SIZE_TYPE, "long long unsigned int") == 0)
+ else if (strcmp (UINTMAX_TYPE, "long long unsigned int") == 0)
{
intmax_type_node = long_long_integer_type_node;
uintmax_type_node = long_long_unsigned_type_node;
- signed_size_type_node = long_long_integer_type_node;
}
else
gcc_unreachable ();
+ signed_size_type_node = signed_type_for (size_type_node);
wint_type_node = unsigned_type_node;
pid_type_node = integer_type_node;
}