This is the mail archive of the gcc-bugs@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]

[Bug rtl-optimization/43907] yet another missed restrict optimization



------- Comment #2 from alexey dot salmin at gmail dot com  2010-04-27 09:46 -------
> restrict only disambiguates against other restrict pointers.
Can you please support that assertion with a reference?

ISO/IEC 9899:TC2 Committee Draft ? May 6, 2005, 6.7.3 paragraph 7
> An object that is accessed through a restrict-qualified
> pointer has a special association with that pointer.
> This association, defined in 6.7.3.1 below, requires
> that all accesses to that object use, directly or
> indirectly, the value of that particular pointer)
> The intended use of the restrict qualifier (like the
> register storage class) is to promote optimization,
> and deleting all instances of the qualifier from all
> preprocessing translation units composing a conforming
> program does not change its meaning (i.e., observable
> behavior).

As far as I understand that paragraph it says nothing about _other_ restrict
pointers.
It plainly says that any access to the memory which "b" points to will be made
using "b" or its derivatives. And since "b" points to "const int" that memory
can not be modified inside the "f" procedure.

Since I wasn't sure I first asked that question in gcc-help mailing list [1].
Ian Lance Taylor [2] and Manuel López-Ibáñez [3] agreed that it
is a missed optimization.

[1] http://gcc.gnu.org/ml/gcc-help/2010-04/msg00233.html
[2] http://gcc.gnu.org/ml/gcc-help/2010-04/msg00250.html
[3] http://gcc.gnu.org/ml/gcc-help/2010-04/msg00256.html


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43907


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