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]

Re: wide-int, ada

On Nov 25, 2013, at 12:46 AM, Eric Botcazou <> wrote:

>> Richi has asked the we break the wide-int patch so that the individual port
>> and front end maintainers can review their parts without have to go through
>> the entire patch.    This patch covers the ada front-end.
> I don't think that the mechanical change in UI_From_gnu is correct, see the 
> comment just above.  The annotate_value change is very likely correct, but 
> please double check and, upon positive outcome, remove the last sentence of 
> the comment just above.  The rest looks good, thanks.

So, given the last change, the remaining bit is:

Index: gcc/ada/gcc-interface/cuintp.c
--- gcc/ada/gcc-interface/cuintp.c	(revision 209754)
+++ gcc/ada/gcc-interface/cuintp.c	(working copy)
@@ -160,7 +160,11 @@ UI_From_gnu (tree Input)
      in a signed 64-bit integer.  */
   if (tree_fits_shwi_p (Input))
     return UI_From_Int (tree_to_shwi (Input));
-  else if (wi::neg_p (Input) && TYPE_UNSIGNED (gnu_type))
+  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;
We need this to ensure that 32 to 63 bit values with the high bit set don’t return No_Uint.  This should also address the performance concerns as well.


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