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

            Bug ID: 124450
           Summary: [16 Regression] trans-io.cc:2516: runtime error
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

For this Fortran 90 source code:

  type tp1
     integer(kind=4) :: t0(3)
     integer(kind=4) :: t1(5)
  end type tp1
  type tc
     type(tp1) :: xx(0) = tp1(1,2)
     type(tp1) :: yy(0)
  end type tc

  type(tc) :: aa
  type(tc) :: bb = tc(tp1(3,4),(tp1(5,6)))

  print *, aa
  print *, bb
end

from the fujitsu test suite at 

https://github.com/fujitsu/compiler-test-suite

does this with recent gfortran:

$ for i in ~/gcc/results.202603*/bin/gfortran; do echo $i; $i -c -w
./trunk/Fortran/0370/0370_0013.f90 ; done
/home/dcb/gcc/results.20260305.ubsan/bin/gfortran
/home/dcb/gcc/results.20260309.ubsan/bin/gfortran
../../trunk/gcc/fortran/trans-io.cc:2516:40: runtime error: member access
within
 null pointer of type 'struct gfc_code'
    #0 0x009ff814 in transfer_expr ../../trunk/gcc/fortran/trans-io.cc:2516
    #1 0x009fecc0 in transfer_array_component
../../trunk/gcc/fortran/trans-io.c
c:2227
    #2 0x009fecc0 in transfer_expr ../../trunk/gcc/fortran/trans-io.cc:2516
    #3 0x00a09dac in gfc_trans_transfer(gfc_code*)
../../trunk/gcc/fortran/trans
-io.cc:2734

The git range is g:ee8ca6c927ec949a .. g:ede3dd56e6324578

I found this bug on the raspberry PI, in 32 bit mode.

Reply via email to