------- Comment #2 from djg at cray dot com 2006-09-20 23:49 ------- The definition of restrict in C99 6.7.3.1 doesn't say that only the original restrict-qualified pointer can be used to access the object it points to; it says that any pointer "based on" the original restrict-qualified pointer may access the object.
Following paragraph #3, q is "based on" p. The code in question in GCC seems to be the code by this comment, in tree-data-ref.c: /* An instruction writing through a restricted pointer is "independent" of any instruction reading or writing through a different pointer, in the same block/scope. */ -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29145