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/51502] [4.6/4.7 Regression] Potentially wrong code generation due to wrong implict_pure check


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51502

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011-12-11
                 CC|                            |tkoenig at gcc dot gnu.org
     Ever Confirmed|0                           |1

--- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> 2011-12-11 20:29:39 UTC ---
Nitpick: A pure procedure could access the variable, but
it could assign a value to it.

Because

module m
  integer :: i
contains
  pure subroutine foo(x)
    integer, intent(inout) :: x
    outer: block
      block
        i = 5
      end block
    end block outer
  end subroutine foo
end module m

gives the error

Error: Variable 'i' can not appear in a variable definition context
(assignment) at (1) in PURE procedure

the fix should be straightforward.


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