This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/85981] ICE in gfc_trans_string_copy, at fortran/trans-expr.c:6539
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 29 May 2018 18:46:43 +0000
- Subject: [Bug fortran/85981] ICE in gfc_trans_string_copy, at fortran/trans-expr.c:6539
- Auto-submitted: auto-generated
- References: <bug-85981-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85981
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-05-29
CC| |kargl at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from kargl at gcc dot gnu.org ---
(In reply to G. Steinmetz from comment #1)
> Works with character(kind=1) :
>
>
> $ cat z2.f90
> program p
> integer, allocatable :: arr(:)
> integer :: stat
> character(len=128, kind=1) :: errmsg = ' '
> allocate (arr(3), stat=stat, errmsg=errmsg)
> print *, allocated(arr), stat, trim(errmsg)
> end
>
>
> $ gfortran-9-20180527 z2.f90 -static-libgfortran
> $ a.out
> T 0
It ought to work with kind=1. For the original code,
and error message should be issued as kind=4 is not
default character kind.
R928 alloc-opt is ERRMSG = errmsg-variable
R930 errmsg-variable is scalar-default-char-variable
R906 default-char-variable is variable
C906 default-char-variable shall be default character.