This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/49733] Missed optimization: Variable value not propagated to remove "if" condition
- 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, 14 Jul 2011 09:26:20 +0000
- Subject: [Bug middle-end/49733] Missed optimization: Variable value not propagated to remove "if" condition
- Auto-submitted: auto-generated
- References: <bug-49733-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49733
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-07-14 09:25:31 UTC ---
(In reply to comment #5)
> Ah, so passing the non-aliasing-var to a function which takes a POINTER
> argument, returning that pointer and modifying it in the function that
> takes the non-aliasing-var is ok then?
POINTER in the C/middle-end or in the Fortran sense?
Passing a non-(Fortran-)POINTER variable as actual argument to a
(Fortran-)POINTER dummy argument is only valid, if the dummy is INTENT(IN) and
if the actual argument is TARGET. The INTENT(IN) makes sure that one does not
change the address to which the pointer points - and the TARGET avoids aliasing
issues. (Cf. "12.5.2.7 Pointer dummy variables".)
Thus, "non-aliasing-var" may not be passed passed to a POINTER dummy argument.