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 middle-end/48390] Multiple setting to restricted pointer variable not optimized away


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.


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