This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: wide-int, ada
- From: Mike Stump <mikestump at comcast dot net>
- To: Eric Botcazou <ebotcazou at adacore dot com>
- Cc: "gcc-patches at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>, Kenneth Zadeck <zadeck at naturalbridge dot com>
- Date: Thu, 24 Apr 2014 11:55:07 -0700
- Subject: Re: wide-int, ada
- Authentication-results: sourceware.org; auth=none
- References: <0075C6DB-B432-4E6F-8A48-3AE0C4D842FE at comcast dot net> <1464599 dot QpNUskFgRu at polaris>
On Nov 25, 2013, at 12:46 AM, Eric Botcazou <ebotcazou@adacore.com> 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;
#endif
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.
Ok?