https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69651
--- Comment #7 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> --- (In reply to Kirill Yukhin from comment #0) > Unfortunately I have no testcase. > > But code itself looks awful to me: Hey, its free as in beer! > /* Worker function to save a KIND=4 character to a string buffer, > enlarging the buffer as necessary. */ > > static void > push_char4 (st_parameter_dt *dtp, int c) > { > gfc_char4_t *new, *p = (gfc_char4_t *) dtp->u.p.saved_string; > The old code used new and I think was just an oversight during edit or merge. > > memset4 (new + dtp->u.p.saved_used, 0, // <-- ??? new==junk ??? > dtp->u.p.saved_length - dtp->u.p.saved_used); But ... the problem is not this code or at least your reproducer code does not use kind=4 characters which the above function is about. I am still investigating. (The above needs fixing regardless) Thanks for report.