This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: restrict on casted pointers
- From: "Paulo Matos" <pmatos at broadcom dot com>
- To: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Wed, 28 Aug 2013 12:35:54 +0000
- Subject: RE: restrict on casted pointers
- Authentication-results: sourceware.org; auth=none
- References: <19EB96622A777C4AB91610E763265F462B0BE8 at SJEXCHMB14 dot corp dot ad dot broadcom dot com> <alpine dot DEB dot 2 dot 10 dot 1308281417170 dot 12838 at stedding dot saclay dot inria dot fr>
> -----Original Message-----
> From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
> Behalf Of Marc Glisse
> Sent: 28 August 2013 13:19
> To: Paulo Matos
> Cc: gcc-help@gcc.gnu.org
> Subject: Re: restrict on casted pointers
>
> You are using int16_t***restrict, and the restrict only goes one layer of
> pointer deep, maybe? (I didn't look very closely)
>
Marc,
Besides the fact that arrays are laid out contiguously in memory so it shouldn't matter, I am marking the pointers through which I access the memory as restrict so GCC shouldn't really care about what I am accessing in memory, only that the pointers involved are marked as restrict. Or at least this is my understanding, GCC seems to think otherwise but it seems like a recent change. gcc-4.5.4 is happy with the restrict keyword in this case and doesn't seem to reload the memory in question.
--
Paulo Matos