trans-expr.c (gfc_conv_string_tmp): Check type compatibility instead of equality.

fortran/
        * trans-expr.c (gfc_conv_string_tmp): Check type compatibility
        instead of equality.

testsuite/
        * gfortran.dg/pr41126.f90: New test.

From-SVN: r150964
This commit is contained in:
Michael Matz 2009-08-20 14:25:36 +00:00 committed by Michael Matz
parent 456976d81d
commit 167f281ea6
4 changed files with 18 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-08-20 Michael Matz <matz@suse.de>
PR fortran/41126
* trans-expr.c (gfc_conv_string_tmp): Check type compatibility
instead of equality.
2009-08-20 Janus Weil <janus@gcc.gnu.org>
PR fortran/41121

View File

@ -1104,7 +1104,7 @@ gfc_conv_string_tmp (gfc_se * se, tree type, tree len)
tree var;
tree tmp;
gcc_assert (TREE_TYPE (len) == gfc_charlen_type_node);
gcc_assert (types_compatible_p (TREE_TYPE (len), gfc_charlen_type_node));
if (gfc_can_put_var_on_stack (len))
{

View File

@ -1,3 +1,8 @@
2009-08-20 Michael Matz <matz@suse.de>
PR fortran/41126
* gfortran.dg/pr41126.f90: New test.
2009-08-20 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/dynamic_bound.adb: New test.

View File

@ -0,0 +1,6 @@
! { dg-do compile }
SUBROUTINE write_cputime( checkpoint )
CHARACTER(LEN=*), INTENT(IN) :: checkpoint
CHARACTER(LEN=LEN_TRIM(checkpoint)+7) :: string1
string1 = ADJUSTL(string1)
END SUBROUTINE write_cputime