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/36462] New: KIND argument in INDEX results in wrong code


$ 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


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