> From: Brian Budge [mailto:brian.budge@xxxxxxxxx] > Sent: 28 August 2013 14:51 > To: Paulo Matos > Cc: GCC-help > Subject: RE: restrict on casted pointers > > > On Aug 28, 2013 5:36 AM, "Paulo Matos" <pmatos@xxxxxxxxxxxx> wrote: > > > -----Original Message----- > > From: gcc-help-owner@xxxxxxxxxxx [mailto:gcc-help-owner@xxxxxxxxxxx] On > > Behalf Of Marc Glisse > > Sent: 28 August 2013 13:19 > > To: Paulo Matos > > Cc: gcc-help@xxxxxxxxxxx > > 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 > > > Another recent post discusses a regression around restrict in 4.8. Searching bugzilla, I found active tickets regarding this missed optimization. > Brian > Now that you mentioned it I did look into bugzilla but didn't find any report that matches my concern. However, there are indeed a few bugs regarding restrict. So, given your reply I guess you support the view that this is a gcc missed optimization instead of a problem in my interpretation of restrict. Paulo Matos