This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [patch, fortran] PR30371: KILL subroutine accepts array arguments.
On Thu, Jan 04, 2007 at 10:13:31PM -0800, Brooks Moses wrote:
> Brooks Moses wrote:
> >Steve Kargl wrote:
> >>Do we also need to the scalar checks in gfc_check_kill?
> >>A quick glance at the code suggests that we do.
> >
> >I'm not sure. The KILL() function is flagged as ELEMENTAL in
> >intrinsic.c, and I'm not familiar enough with how elemental functions
> >are handled to know if that will do the right thing or not.
>
> Well, something does the wrong thing, anyway:
>
> debian-gfortran:~/test> cat kill9.f90
> program kill9
> integer i1, i2, stat(2)
> stat = kill( (/i1, i2/), (/9, 9/) )
> end
>
> debian-gfortran:~/test> ../bin-trunk/bin/gfortran kill9.f90 -o kill9
> kill9.f90: In function 'MAIN__':
> kill9.f90:1: internal compiler error: in gfc_conv_intrinsic_funcall, at
> fortran/trans-intrinsic.c:1452
>
> Ideally, since KILL is documented as an elemental function, this ought
> to work. Though we could just make it non-elemental and put in checks,
> as the simple way out.
>
I vote for making nonelemental. This is what g77 had. Otherwise,
we'll need implement better name resolution in iresolve.c and
implement the array versions of kill(). Seems like a lot of work
for little return.
--
Steve