https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113671
Bug ID: 113671 Summary: Passing allocatable character(:) slices with negative stride: invalid memory access / segfault Product: gcc Version: 13.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: orbisvicis+gcc at gmail dot com Target Milestone: --- Created attachment 57262 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57262&action=edit Various conditions to explore the invalid memory access When passing an allocatable character(:) slice with negative stride, gfortran either segfaults or accesses invalid memory. * GNU Fortran (GCC) 11.4.0 on Cygwin 3.4.7-1.x86_64 segfaults (invalid memory access) * x86_64 GFortran 13.2|trunk on godbolt.org accesses invalid memory Actual output: ``` testing: 1 3 5 one ! ``` Expected output: ``` testing: 1 3 5 three two one ```