This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/36462] New: KIND argument in INDEX results in wrong code
- From: "fxcoudert at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jun 2008 01:22:11 -0000
- Subject: [Bug fortran/36462] New: KIND argument in INDEX results in wrong code
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat a.f90
character(10) string
string = 'ABCDEEDCBA'
write(*,*) index(string,'A',kind=1)
end
$ gfortran a.f90 && ./a.out
10
I suspect we're passing 1 as a logical BACK argument to the library function.
Well, I do more than suspect, I checked and that's indeed what we do :)
Work needed in trans-intrinsic.c, probably an easy one. Will need auditing
other intrinsics that were added a KIND argument in F2003.
--
Summary: KIND argument in INDEX results in wrong code
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: fxcoudert at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36462