diff mbox series

[Ada] Remove obsolete code in UI_From_gnu

Message ID 3145035.D4gqUL5a56@polaris
State New
Headers show
Series [Ada] Remove obsolete code in UI_From_gnu | expand

Commit Message

Eric Botcazou Nov. 19, 2018, 9:47 a.m. UTC
Now that HOST_BITS_PER_WIDE_INT is always 64, we can get rid of disabled code 
in the UI_From_gnu routine.

Tested on x86_64-suse-linux, applied on the mainline.


2018-11-19  Eric Botcazou  <ebotcazou@adacore.com>

	* gcc-interface/cuintp.c (UI_From_gnu): Remove code for 32-bit hosts.
diff mbox series

Patch

Index: gcc-interface/cuintp.c
===================================================================
--- gcc-interface/cuintp.c	(revision 266178)
+++ gcc-interface/cuintp.c	(working copy)
@@ -142,13 +142,16 @@  UI_From_gnu (tree Input)
   /* UI_Base is defined so that 5 Uint digits is sufficient to hold the
      largest possible signed 64-bit value.  */
   const int Max_For_Dint = 5;
-  int v[Max_For_Dint], i;
+  int v[Max_For_Dint];
   Vector_Template temp;
   Int_Vector vec;
 
-#if HOST_BITS_PER_WIDE_INT == 64
-  /* On 64-bit hosts, tree_fits_shwi_p tells whether the input fits in a
-     signed 64-bit integer.  Then a truncation tells whether it fits
+#if HOST_BITS_PER_WIDE_INT < 64
+#error unsupported HOST_BITS_PER_WIDE_INT setting
+#endif
+
+  /* On 64-bit hosts, tree_fits_shwi_p tells whether the input fits in
+     a signed 64-bit integer.  Then a truncation tells whether it fits
      in a signed 32-bit integer.  */
   if (tree_fits_shwi_p (Input))
     {
@@ -158,24 +161,11 @@  UI_From_gnu (tree Input)
     }
   else
     return No_Uint;
-#else
-  /* On 32-bit hosts, tree_fits_shwi_p tells whether the input fits in a
-     signed 32-bit integer.  Then a sign test tells whether it fits
-     in a signed 64-bit integer.  */
-  if (tree_fits_shwi_p (Input))
-    return UI_From_Int (tree_to_shwi (Input));
-
-  gcc_assert (TYPE_PRECISION (gnu_type) <= 64);
-  if (TYPE_UNSIGNED (gnu_type)
-      && TYPE_PRECISION (gnu_type) == 64
-      && wi::neg_p (Input, SIGNED))
-    return No_Uint;
-#endif
 
   gnu_base = build_int_cst (gnu_type, UI_Base);
   gnu_temp = Input;
 
-  for (i = Max_For_Dint - 1; i >= 0; i--)
+  for (int i = Max_For_Dint - 1; i >= 0; i--)
     {
       v[i] = tree_to_shwi (fold_build1 (ABS_EXPR, gnu_type,
 					fold_build2 (TRUNC_MOD_EXPR, gnu_type,