https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113793
--- Comment #2 from anlauf at gcc dot gnu.org --- Created attachment 57354 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57354&action=edit Tentative partial patch This appears to fix the malloc size for character arrays, but not for allocatable scalars, like in: program p implicit none CHARACTER*30, allocatable :: a(:), b(:,:), d CHARACTER(kind=4,len=15),allocatable :: c(:), e ALLOCATE (a(100),source=" ") ! OK ALLOCATE (b(5,6),source=" ") ! OK ALLOCATE (c(42), source=4_"zzz") ! OK ALLOCATE (d,source="xx") ! malloc too small ALLOCATE (e,source=4_"zz") ! malloc too small END