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 fortran/23169] INTENT information not used in the middle-end for optimizations



------- 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


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