https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83551

            Bug ID: 83551
           Summary: ICE on valid code - function with a pointer result
           Product: gcc
           Version: 7.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gilbert.scott at easynet dot co.uk
  Target Milestone: ---

$ gfortran --version
GNU Fortran (GCC) 7.2.1 20170915 (Red Hat 7.2.1-2)

$ cat test.f95
PROGRAM TEST
IMPLICIT NONE

TYPE A
   INTEGER :: I
END TYPE A
TYPE X
   TYPE(A) :: B(5)
END TYPE X
TYPE(X) :: Y
INTEGER, POINTER :: P(:)

P => F(Y)

CONTAINS

FUNCTION F(Z)
INTEGER, POINTER :: F(:)
TYPE(X), INTENT(IN), TARGET :: Z
F => Z%B%I
END FUNCTION F

END PROGRAM TEST

$ gfortran -Wall -std=gnu test.f95 -o test
test.f95:20:0:

 F => Z%B%I

internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.


? What is wrong with line 20?
I think the program is standard conforming fortran.
If not, then a polite error message would be useful.

Reply via email to