This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/44265] Link error with reference to parameter array in specification expression
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Jun 2016 09:11:47 +0000
- Subject: [Bug fortran/44265] Link error with reference to parameter array in specification expression
- Auto-submitted: auto-generated
- References: <bug-44265-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44265
--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
While trying to package the patch in comment 5, I stumbled on the following
problem in 32 mode: the following code
MODULE Fruits
IMPLICIT NONE
PRIVATE
PUBLIC :: Get
CONTAINS
FUNCTION Get(i) RESULT(s)
CHARACTER(len=7), PARAMETER :: names(3) = [ &
'Apple ', &
'Orange ', &
'Mango ' ];
INTEGER, INTENT(IN) :: i
CHARACTER(LEN_TRIM(names(i))) :: s
!****
s = names(i)
print *, len(s)
END FUNCTION Get
END MODULE Fruits
PROGRAM WheresThatbLinkingConstantGone
USE Fruits
IMPLICIT NONE
integer :: i
i = len(Get(1))
print *, i
END PROGRAM WheresThatbLinkingConstantGone
outputs at run time
5
5
when compiled with -m64, but
5
7
when compiled with -m32 (x86_64-apple-darwin15).
The function Get(i) works as expected when used as a contained proc or through
an interface.