This is the mail archive of the gcc-help@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: Pointless use of restrict


Marcus Clyne <maccaday@gmail.com> writes:

> Can anyone explain what GCC does differently for the two following
> definitions:
>
> func1 (my_type_t * __restrict, my_type_t *__restrict);
>
> AND
>
> func2 (my_type_t *, my_type_t *);
>
> ?

In the former cases, references through the pointers will be presumed to
not alias.  That is, memory reads and writes through those pointers may
be reordered compared to how they appear in the program.  This generally
does not make too much difference on processors which execute
instructions out-of-order, such as all modern Intel/AMD processors.

Ian


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