This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/23169] INTENT information not used in the middle-end for optimizations
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Oct 2005 17:41:43 -0000
- Subject: [Bug fortran/23169] INTENT information not used in the middle-end for optimizations
- References: <bug-23169-280@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from pinskia at gcc dot gnu dot org 2005-10-09 17:41 -------
There are a couple of problems here. First I noticed that bar in foo is not
marked as pure even though the IPA mechanism marked it as such, so that looks
like a fortran front-end bug in that it has two different DECLs for the same
function.
The second issue after that is filed as PR 24287 which talks about pure
functions causing local variables to be call clobbered even though they don't
escape. This issue is related to PR 23134 also.
Here is a testcase which we would not get unless we take intent(in) into
account:
integer function foo(b,c)
integer, intent(in) :: b, c
integer :: d, e
d = b;
e = c;
call bar(b,c)
foo = d-b + e-c;
end function
foo should always be zero as bar should not be able to touch b or c.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23169