This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Pointless use of restrict
- From: Ian Lance Taylor <iant at google dot com>
- To: Marcus Clyne <maccaday at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 17 Aug 2009 09:29:51 -0700
- Subject: Re: Pointless use of restrict
- References: <4A887E53.6050800@gmail.com>
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