The line 23 of gfortran.dg/result_in_spec_1.f90 (PR 31215) contains r(:)(i:i) = achar(mod(i,32)+iachar('@'))
With glibc's MALLOC_CHECK_=2 the program simply segfaults. Running the test case using valgrind gives the following error: ==12576== Invalid write of size 1 ==12576== at 0x4C23DD7: memmove (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==12576== by 0x400ACF: __test1__test2 (result_in_spec_1.f90:23) ==12576== by 0x4011D1: myfunc.1445 (result_in_spec_1.f90:42) ==12576== by 0x400E9B: MAIN__ (result_in_spec_1.f90:35) ==12576== by 0x4014EB: main (fmain.c:22) ==12576== Address 0x404E8BE is 0 bytes after a block of size 6 alloc'd ==12576== at 0x4C22D06: malloc (in /usr/lib64/valgrind/amd64-linux/vgpreload_memcheck.so) ==12576== by 0x4E3ED38: _gfortrani_get_mem (memory.c:53) ==12576== by 0x40119F: myfunc.1445 (result_in_spec_1.f90:42) ==12576== by 0x400E9B: MAIN__ (result_in_spec_1.f90:35) ==12576== by 0x4014EB: main (fmain.c:22) -- Summary: result_in_spec_1.f90: Invalid write Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: wrong-code Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31538