d: Fix internal compiler error: in d_build_c_type_nodes, at d/d-builtins.cc:783
authorIain Buclaw <ibuclaw@gdcproject.org>
Wed, 21 Aug 2019 07:53:15 +0000 (07:53 +0000)
committerIain Buclaw <ibuclaw@gcc.gnu.org>
Wed, 21 Aug 2019 07:53:15 +0000 (07:53 +0000)
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.

From-SVN: r274766

gcc/d/ChangeLog
gcc/d/d-builtins.cc

index 00845df4de177d42184b81362559cc7c958c9f8a..6b692f5cf3594e67865a066982e90f75eecd13ce 100644 (file)
@@ -1,3 +1,10 @@
+2019-08-20  Iain Buclaw  <ibuclaw@gdcproject.org>
+
+       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.
+
 2019-08-20  Iain Buclaw  <ibuclaw@gdcproject.org>
 
        PR d/90444
index 5619ebb1a097c82208f21399ea2e37e7ea2e61e3..2f7319c1effb9d7c7351a576b4ed761382b0d458 100644 (file)
@@ -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;
 }