https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68441
Bug ID: 68441
Summary: ICE on using transfer with character parameter
Product: gcc
Version: 5.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: [email protected]
Target Milestone: ---
For some tests of "TRANSFER (TRANSFER (E, D), E)" :
$ cat z1.f90
program p
character(huge(1_1)), parameter :: x = 'abc'
print *, transfer(transfer(0, x), 0)
end
$ gfortran-5 -g -O0 -Wall -fcheck=all z1.f90
f951: internal compiler error: in gfc_interpret_character, at
fortran/target-memory.c:458
---
Whereas :
$ cat z2.f90
program p
character(huge(1_1)) :: x = 'abc'
print *, transfer(transfer(0, x), 0)
end
$ gfortran-5 -g -O0 -Wall -fcheck=all z2.f90
z2.f90:3:30:
print *, transfer(transfer(0, x), 0)
1
Warning: Intrinsic TRANSFER at (1) has partly undefined result: source size 4 <
result size 127
$ a.out
0