This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/41520] New: PARAMETER statement in module subrouines
- From: "ros at rzg dot mpg dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 Sep 2009 16:38:59 -0000
- Subject: [Bug fortran/41520] New: PARAMETER statement in module subrouines
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Using the PARAMETER statement in a module subroutine for assigning values to a
character array yields nonsense when printed at runtime. If, instead, the
PARAMETER attribute is used, everything is fine.
gfortran -v yields:
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /home/jerry/gcc/trunk/configure --prefix=/usr/local/gfortran
--enable-languages=c,fortran --disable-libmudflap --enable-libgomp
--disable-shared
Thread model: posix
gcc version 4.5.0 20090922 (experimental) [trunk revision 151967] (GCC)
uname -a yields:
Linux ros-nb 2.6.25.20-0.5-pae #1 SMP 2009-08-14 01:48:11 +0200 i686 i686 i386
GNU/Linux
The following shows the test program:
Module BUG3
!
contains
!
Subroutine SR
!
character(3) :: parm(5)
!
parameter(parm=(/'xo ','yo ','ag ','xr ','yr '/))
write(*,*) parm
!
end subroutine SR
!
end Module BUG3
!
program TEST
use bug3
!
call sr
!
end program TEST
--
Summary: PARAMETER statement in module subrouines
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ros at rzg dot mpg dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41520