This is the mail archive of the
mailing list for the GCC project.
Re: wide-int, fortran
- From: Kenneth Zadeck <zadeck at naturalbridge dot com>
- To: Tobias Burnus <burnus at net-b dot de>, Mike Stump <mikestump at comcast dot net>, "gcc-patches at gcc dot gnu dot org Patches" <gcc-patches at gcc dot gnu dot org>
- Cc: gfortran List <fortran at gcc dot gnu dot org>
- Date: Sun, 24 Nov 2013 07:56:58 -0500
- Subject: Re: wide-int, fortran
- Authentication-results: sourceware.org; auth=none
- References: <DDF8569C-14AF-4E64-AA91-0EA50A49E043 at comcast dot net> <5291D9EA dot 2020207 at net-b dot de>
On 11/24/2013 05:50 AM, Tobias Burnus wrote:
This is the magic of using the correct representation. All this code
really wanted to check is that bound is a small positive integer.
Mike Stump 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
fortran front end.
Nice clean up. The new class looks much cleaner as it avoids the LO/HI
- hi = TREE_INT_CST_HIGH (bound);
- low = TREE_INT_CST_LOW (bound);
- if (hi || low < 0
- || ((!as || as->type != AS_ASSUMED_RANK)
- && low >= GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc)))
- || low > GFC_MAX_DIMENSIONS)
+ if (((!as || as->type != AS_ASSUMED_RANK)
+ && wi::geu_p (bound, GFC_TYPE_ARRAY_RANK (TREE_TYPE (desc))))
+ || wi::gtu_p (bound, GFC_MAX_DIMENSIONS))
gfc_error ("'dim' argument of %s intrinsic at %L is not a valid "
"dimension index", upper ? "UBOUND" : "LBOUND",
I don't see what happened to the "low < 0" check. (Ditto for the next
chunk in conv_intrinsic_cobound).
Otherwise, it looks okay to me.