This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Fortran-dev, patch] Use only lbound/extent/sm in the array descriptor
- From: Thomas Koenig <tkoenig at netcologne dot de>
- To: Tobias Burnus <burnus at net-b dot de>
- Cc: gcc patches <gcc-patches at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>
- Date: Sun, 11 Mar 2012 18:34:47 +0100
- Subject: Re: [Fortran-dev, patch] Use only lbound/extent/sm in the array descriptor
- References: <4F5CA374.2060108@net-b.de>
Hi Tobias,
with that patch, the array descriptor on the fortran-dev branch uses now
the dimension triplet as defined in TS29113. This patch removes
ubound/stride and updates all calls.
Great!
There are still 227 test-suite failures ("FAIL" lines) affecting 27
test-suite files. That's slightly down from the 269 lines the branch
currently has. (Some issues can be fixed by modifying the tree dump
patterns, but most seem to be "real" problems.)
Build and regtested on x86-64-linux.
OK for the branch?
The library parts look OK to me.
There is just one point of efficiency.
+#define GFC_DESCRIPTOR_STRIDE(desc,i) \
+ (GFC_DESCRIPTOR_SM(desc,i) / GFC_DESCRIPTOR_SIZE(desc))
In most generated files, GFC_DESCRIPTOR_SIZE is a constant known
at compile-time (and usually a power of two), which means that the
division can be done in a simple shift. If we get the size from the
descriptor, we actually have to divide, which is expensive.
I would commit the patch now, adding
TODO:
- Fixing the regressions.
- Cleanup of the library and the front end
- Switching also from ubound -> extent for nondescriptor arrays?
- Properly implement subpointers
- Avoid division for GFC_DESCRIPTOR_STRIDE where possible.
Thomas