Hello world, I have committed the attached patch as obvious and simple after regression-testing. I could not construct a test case that actually failed, though, but the logic was wrong (pointer aliasing and the field that was accessed had the wrong offset).
Commit is r15-6831-g40754a3b9bef83bf4da0675fcb378e8cd1675602 . Best regards Thomas Author: Thomas Koenig <tkoe...@gcc.gnu.org> Date: Sun Jan 12 13:05:25 2025 +0100 Fix union member access for EXEC_INQUIRE. gcc/fortran/ChangeLog: PR fortran/118432 * frontend-passes.cc (doloop_code): Select correct member of co->ext.union for inquire.
diff --git a/gcc/fortran/frontend-passes.cc b/gcc/fortran/frontend-passes.cc index 3a3328d4450..6ee6ce4c3ff 100644 --- a/gcc/fortran/frontend-passes.cc +++ b/gcc/fortran/frontend-passes.cc @@ -2552,7 +2552,7 @@ doloop_code (gfc_code **c, int *walk_subtrees ATTRIBUTE_UNUSED, break; case EXEC_INQUIRE: - if (co->ext.filepos->err) + if (co->ext.inquire->err) seen_goto = true; break;