This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use pointer sized array indices.
- From: Thomas Koenig <tkoenig at netcologne dot de>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>, fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 29 Dec 2017 18:17:48 +0100
- Subject: Re: [PATCH] Use pointer sized array indices.
- Authentication-results: sourceware.org; auth=none
- References: <1514564021-3546-1-git-send-email-blomqvist.janne@gmail.com>
Hi Janne,
Using pointer sized variables (e.g. size_t / ptrdiff_t) when the
variables are used as array indices allows accessing larger arrays,
and can be a slight performance improvement due to no need for sign or
zero extending, or masking.
Unless I have missed something, all the examples are for cases where
the array is of maximum size GFC_MAX_DIMENSIONS. This is why they
were left as int in the first place (because it is unlikely we will have
arrays of more than 2^31-1 dimensions soon :-).
Do you really think this change is necessary? If not, I'd rather avoid
such a change.
Regards
Thomas