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/30522] New: Host-/use-associated VOLATILE variable: volatile scope, redundent attributes


(This bug description assumes that the patch to PR30520 is already applied.)

gfortran currently permits the following redundant VOLATILE attributes:

module A
 real :: vol
end module A
module B
  use A
  volatile :: vol
  volatile :: vol ! WRONG, but accepted
end module B

gfortran wrongly rejects the following VOLATILE:

module test
  real, volatile :: A
contains
  subroutine sub
    volatile :: A ! VALID, but rejected
  end subroutine sub
end module test

Check: In the following example, the variable "global" should only be volatile
in subroutine A. Does this really happen?

program test
  real :: global
  ! global should not be volatile here
contains
  subroutine A
    volatile :: global
  end subroutine A
  subroutine B
  ! global should not be volatile here
  end subroutine B
end program test


-- 
           Summary: Host-/use-associated VOLATILE variable: volatile scope,
                    redundent attributes
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid, accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org
 BugsThisDependsOn: 30520


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


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