Commit 3434e9a4 by Tobias Burnus Committed by Tobias Burnus

re PR fortran/37076 (Concatenation of KIND=4 strings with KIND=4 parameters fails)

2008-08-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37076
        * arith.c (gfc_arith_concat): Fix concat of kind=4 strings.

2008-08-23  Tobias Burnus  <burnus@net-b.de>

        PR fortran/37076
        * gfortran.dg/widechar_9.f90: New.

From-SVN: r139521
parent 12ba225d
2008-08-23 Tobias Burnus <burnus@net-b.de>
PR fortran/37076
* arith.c (gfc_arith_concat): Fix concat of kind=4 strings.
2008-08-23 Tobias Burnus <burnus@net-b.de>
PR fortran/37025
* target-memory.c (gfc_interpret_character): Support
kind=4 characters.
......
......@@ -1069,7 +1069,8 @@ gfc_arith_concat (gfc_expr *op1, gfc_expr *op2, gfc_expr **resultp)
gfc_expr *result;
int len;
result = gfc_constant_result (BT_CHARACTER, gfc_default_character_kind,
gcc_assert (op1->ts.kind == op2->ts.kind);
result = gfc_constant_result (BT_CHARACTER, op1->ts.kind,
&op1->where);
len = op1->value.character.length + op2->value.character.length;
......
2008-08-23 Tobias Burnus <burnus@net-b.de>
PR fortran/37076
* gfortran.dg/widechar_9.f90: New.
2008-08-23 Tobias Burnus <burnus@net-b.de>
PR fortran/37025
* gfortran.dg/widechar_8.f90: New.
......
! { dg-do compile }
!
! PR fortran/37076
!
! Before the result of concatenations was always a kind=1 string
!
program test3
integer,parameter :: u = 4
character(1,u),parameter :: nen=char(int(z'5e74'),u) !year
character(25,u) :: string
string = u_"2008"//nen
print *, u_"2008"//nen ! Compiles OK
print *, u_"2008"//nen//u_"8" ! Rejects this.
end program test3
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment