https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124661
Bug ID: 124661
Summary: SIGSEGV with -fcheck=bounds from type-bound procedure
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: albandil at atlas dot cz
Target Milestone: ---
Created attachment 64047
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=64047&action=edit
A small reproducer of the issue.
When I compile a simple Fortran program (attached) with -fcheck=bounds, it
segfaults during execution on array assignment within a type-bound procedure.
Without -fcheck=bounds it runs correctly.
I was able to bisect the issue to the below commit. Compiling with
-fcheck=bounds before that commit produces a non-failing executable.
1800ac20f66812c72b144848f7ec8e66156f06f8 is the first bad commit
commit 1800ac20f66812c72b144848f7ec8e66156f06f8 (HEAD)
Author: Mikael Morin <[email protected]>
Date: Sun Jul 27 17:11:50 2025 +0200
fortran: Trigger reference saving on pointer dereference [PR121185]