------- Comment #6 from jakub at gcc dot gnu dot org 2008-05-06 22:56 ------- Created an attachment (id=15588) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15588&action=view) gcc44-pr36013.patch
Patch I've bootstrapped/regtested on x86_64-linux. Will you check this in, or should I mail it to gcc-patches? I've played with testcases like: int foo (int *__restrict p, int *__restrict q) { int *r, *s, t; *p = 1; *q = 2; p[6] = 3; q[6] = 4; for (r = p, s = q, t = 0; r < p + 64; r++, s++) { *r = 7; *s = 88; t += *r; } return t; } and here neither tree nor RTL aliasing is ATM able to optimize the subsequent read from *r out - while the accesses before the loop use different alias sets (3 resp. 4), in the loop everything uses alias set 2, but that isn't a regression introduced with this patch, so probably DECL_BASED_ON_RESTRICT_P stuff needs more work, but that is unrelated to this bug. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36013