https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108693
anlauf at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |ice-on-valid-code Ever confirmed|0 |1 Last reconfirmed| |2023-02-07 --- Comment #1 from anlauf at gcc dot gnu.org --- The code has a simple bug, as it violates array bounds as threads are counted starting from 0, not 1. This is fixed by replacing thread_id = OMP_GET_THREAD_NUM() by thread_id = OMP_GET_THREAD_NUM() + 1 The ICE seems to occur only for deferred character length variables. A small modification to use an array of character(len=1) seems to work.