diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 6e0a73b5d59..16467434e37 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2005-05-18 Feng Wang + + PR fortran/20954 + * trans-const.c (gfc_conv_const_charlen): Use gfc_charlen_type_node to + build character length. + 2005-05-17 Zdenek Dvorak * trans-types.c (gfc_array_range_type): New variable. diff --git a/gcc/fortran/trans-const.c b/gcc/fortran/trans-const.c index 0351e124096..57c34d7dd1b 100644 --- a/gcc/fortran/trans-const.c +++ b/gcc/fortran/trans-const.c @@ -141,6 +141,8 @@ gfc_conv_const_charlen (gfc_charlen * cl) { cl->backend_decl = gfc_conv_mpz_to_tree (cl->length->value.integer, cl->length->ts.kind); + cl->backend_decl = fold_convert (gfc_charlen_type_node, + cl->backend_decl); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4a49b014550..38f657905ed 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-05-18 Feng Wang + + PR fortran/20954 + * gfortran.dg/pr20954.f: New test. + 2005-05-17 Mike Stump Yet more Objective-C++... @@ -26,6 +31,7 @@ libiberty.h. * gcc.dg/compat/generate-random_r.c: Likewise. +>>>>>>> 1.5488 2005-05-17 Paolo Bonzini * gcc.dg/fold-div-1.c, gcc.dg/recip-1.c, gcc.dg/recip-2.c: New. diff --git a/gcc/testsuite/gfortran.dg/pr20954.f b/gcc/testsuite/gfortran.dg/pr20954.f new file mode 100644 index 00000000000..b19b782f667 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr20954.f @@ -0,0 +1,11 @@ + ! { dg-do run } + ! { dg-options "-fdefault-integer-8" } + ! Program to test character length type + Program pr20954 + character*16 string (5) + character*5 filename + character*80 line + filename = 'input' + open (2,file=filename) + write (line, '(5a16)') (string(i),i=1,5) + end