PR 84615 Regressions due to type mismatch with character functions
commit9ecbb6eaf0ea6e4cfc017d803d6aef1367716357
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Mar 2018 18:46:44 +0000 (21 18:46 +0000)
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Mar 2018 18:46:44 +0000 (21 18:46 +0000)
tree9237e503aac33b16a9206822adb2413c0e98e3ab
parentc49bd35e801fc439c21a86bde6da8490a96218b1
PR 84615 Regressions due to type mismatch with character functions

Since the kind of the hidden character length variable is not part of
the character variable definition, we must ensure that character
lengths are always of the same kind in interfaces, regardless of how
they were declared in the source. This patch ensures this when calling
a procedure.

Regtested on x86_64-pc-linux-gnu and i686-pc-linux-gnu.

gcc/fortran/ChangeLog:

2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/84615
* trans-expr.c (gfc_conv_procedure_call): Convert charlen to
gfc_charlen_type_node when calling procedure.

gcc/testsuite/ChangeLog:

2018-03-21  Janne Blomqvist  <jb@gcc.gnu.org>

PR fortran/84615
* gfortran.dg/char_result_17.f90: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@258736 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/char_result_17.f90 [new file with mode: 0644]