This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, PR d/90445] Committed fix for ICE in d_build_c_type_nodes, at d/


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.


        PR d/90445
        * (d_build_c_type_nodes): Test UINTMAX_TYPE for setting
        uintmax_type_node.  Set signed_size_type_node as the signed_type_for
diff --git a/gcc/d/ b/gcc/d/
index 845f6a3d586..c90fc9051d9 100644
--- a/gcc/d/
+++ b/gcc/d/
@@ -762,27 +762,25 @@ d_build_c_type_nodes (void)
     = build_pointer_type (build_qualified_type (char_type_node,
-  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;
     gcc_unreachable ();
+  signed_size_type_node = signed_type_for (size_type_node);
   wint_type_node = unsigned_type_node;
   pid_type_node = integer_type_node;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]