Re: Pointless use of restrict

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Marcus Clyne <maccaday@xxxxxxxxx> 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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux