Bug 36462 - [F03] Audit intrinsics for KIND arguments
Summary: [F03] Audit intrinsics for KIND arguments
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: F2003
  Show dependency treegraph
 
Reported: 2008-06-08 01:22 UTC by Francois-Xavier Coudert
Modified: 2014-06-07 08:11 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-06-08 11:20:55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois-Xavier Coudert 2008-06-08 01:22:11 UTC
$ 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.
Comment 1 Tobias Burnus 2008-06-08 11:20:55 UTC
Note: Initially found by James Van Buskirk:
http://groups.google.com/group/comp.lang.fortran/msg/e90575a5a6a50e35

Comment 2 Tobias Burnus 2008-06-12 16:16:50 UTC
Fixed for INDEX and SCAN, but leaving open as reminder for the following:

> Will need auditing other intrinsics that were added a KIND argument in F2003.
Comment 3 Tobias Burnus 2008-06-12 16:17:32 UTC
Subject: Bug 36462

Author: burnus
Date: Thu Jun 12 16:16:39 2008
New Revision: 136712

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136712
Log:
2008-06-12  Tobias Burnus  <burnus@net-b.de>

        PR fortran/36462
        * trans-intrinsic.c (gfc_conv_intrinsic_index_scan_verify):
        Fix passing of the BACK= argument.

2008-06-12  Tobias Burnus  <burnus@net-b.de>

        PR fortran/36462
        * gfortran.dg/index_2.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/index_2.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-intrinsic.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Daniel Franke 2009-01-04 00:10:15 UTC
See also: PR29600.
Comment 5 Thomas Koenig 2011-01-08 10:07:18 UTC
Adjusting Subject, removing wrong-code.
Comment 6 Francois-Xavier Coudert 2014-06-07 08:11:12 UTC
After a long and tedious look through the F2003 and F2008 standards, it appears we've got this covered.