This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/48390] Multiple setting to restricted pointer variable not optimized away
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 31 Mar 2011 16:16:01 +0000
- Subject: [Bug middle-end/48390] Multiple setting to restricted pointer variable not optimized away
- Auto-submitted: auto-generated
- References: <bug-48390-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48390
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-31 16:15:56 UTC ---
For the C case: If "ptr" is also "restrict", the "*a = 1" is optimized away.
Ditto for Fortran, if "ptr" is not a POINTER but a normal variable.
In case of Fortran, the a/b/c cannot alias with ptr as none of has the TARGET
attribute. I would expect the same for C99 as a/b/c are "restrict" but maybe I
am wrong about the C99 semantics.