GCC not (optimally) exploiting restrict pointers?
Mike Stump
mrs@apple.com
Thu Dec 16 06:19:00 GMT 2004
On Dec 15, 2004, at 4:34 AM, Richard Guenther wrote:
> Now, if I read 6.7.3 (7) correct, the second output is correct for the
> first case, too. And in fact, the Intel compiler produces the
> optimized output in _both_ cases.
Agreed.
> Is GCC right in not doing the optimization in the first case,
No.
> or has it just missed the optimization opportunity?
Just missed it.
I found http://www.lysator.liu.se/c/restrict.html an informative read...
I think:
[#3] In what follows, a pointer expression E is said to be
based on object P if (at some sequence point in the
execution of B prior to the evaluation of E) modifying P to
point to a copy of the array object into which it formerly
pointed would change the value of E.106) Note that |
``based'' is defined only for expressions with pointer
types.
is pretty clear as is 3.6 from the above link.
More information about the Gcc
mailing list