https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121435
Bug ID: 121435
Summary: Incorrect result with default pointer initialization
Product: gcc
Version: 15.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
Assignee: unassigned at gcc dot gnu.org
Reporter: jean.vezina at gmail dot com
Target Milestone: ---
Created attachment 62070
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62070&action=edit
Test case for the bug
When a pointer in a derived type definition is initialized with an array
defined outside the derived type, it is not properly associated with the
target.
Steps to reproduce the problem:
Compile the test program with the commmand:
gfortran ptr_init.f90
Run the executable:
./a.out
Instead of printing 1 2 3 4 5, the result is 0, showing that the association is
incorrect.
The program was checked with Intel Fortran (ifx).
Thanks,
Jean Vézina