This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, libgfortran] Fix PR24459 Namelist problem


Jerry,

The patch is fine but I would like you to develop the testcase a bit to respond to #3 in the testcase, where the reference in the namelist input is to the array without a qualifier. Last night, whilst out of internet range, I developed your prototype testcase to:

program diag
integer(4) :: i, j
integer(4), parameter :: nd = 5
character(8) :: names(nd, nd), names2(nd, nd)
namelist /diags/ names, names2
names = "0"
names2 = "0"
open(UNIT=20, STATUS='scratch')
write (20, '(a)') &
"&DIAGS", &
" NAMES(2,2) = 'frogger' !single element", &
" NAMES(1:5:2,1) = 'ETAN' 'ETANSQ' 'DETADT2' !standard compliant", &
" 'PHIBOT' 'PHIBOTSQ'", &
" NAMES(1,3) = 'ETAN' '0' 'ETANSQ' '0' 'DETADT2' !old style ", &
" 'PHIBOT' 'frogger' 'PHIBOTSQ'", &
" NAMES2 = 'ETAN' '0' 'ETANSQ' '0' 'DETADT2' 'PHIBOT' !old style ", &
" 'frogger' 'PHIBOTSQ' '0' '0' 'ETAN' '0'", &
" 'ETANSQ' '0' 'DETADT2' 'PHIBOT' 'frogger' ", &
" 'PHIBOTSQ' /"


 rewind (20)
 read (20, NML = diags)
 close (20)
 if (any (names .ne. names2)) call abort ()
end

Note the reference to NAMES2 in the input. With a similar reference in your testcase, you can commit to trunk and 4.1.

Best regards

Paul


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]