This is the mail archive of the gcc-patches@gcc.gnu.org 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: [PATCH] Use pointer sized array indices.


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


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