This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/29145] unsafe use of restrict qualifier
- From: "dberlin at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Nov 2006 04:15:31 -0000
- Subject: [Bug tree-optimization/29145] unsafe use of restrict qualifier
- References: <bug-29145-12972@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from dberlin at gcc dot gnu dot org 2006-11-04 04:15 -------
This was something that slipped in, IIRC. I was of Ian's viewpoint, that
may_alias_p should handle it, and it shouldn't be special to data-references.
But it can't, at least in it's current state, because it somehow gets stripped.
I forget the exact details, but diego has explained this to me before :).
Diego, what was the deal with restrict and stripping qualifications that caused
us to not see restrict when it comes time for may_alias_p?
Anyway, what exactly does "based on" mean?
is the following legal?
int *whee(int *__restrict a)
{
return a - 2;
}
void with_restrict(int * __restrict p)
{
int i;
int *q = whee(p);
for (i = 0; i < 1000; ++i) {
p[i] = q[i];
}
If so, we'll never be able to get restrict right on a intraprocedural basis,
and it makes restrict completely useless for almost all cases that restricted
pointers escape :)
--
dberlin at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dnovillo at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29145