This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, fortran] PR30236 - alternate-return subroutine in generic interface causes ice/segfault
- From: Brooks Moses <brooks dot moses at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: fortran at gcc dot gnu dot org
- Date: Mon, 18 Dec 2006 00:08:30 -0800
- Subject: Re: [Patch, fortran] PR30236 - alternate-return subroutine in generic interface causes ice/segfault
- References: <45863DD6.email@example.com>
Paul Thomas wrote:
A wrinkle here is whether or not this is valid fortran. Most compilers
that I have access to seem to quietly compile this..... well, noisily,
actually, since they complain about the obsolescent feature, but compile
it they do. However, in the thread on comp.lang.fortran;
Michael Metcalf offers the advice that this is invalid because the
alternate returns are not data object arguments and should not be counted.
Brooks, as reporter and correspondent on the fortran thread, what do you
think? Is this a -std=gnu or unconditionally an error?
There's a tiny-but-significant difference between this testcase and what
I described on the comp.lang.fortran thread. This case is unambiguously
legal (unless I'm missing something like "alternate returns are not
allowed in generic interfaces at all", which Mike's answer on to my
question on c.l.f. implies that I'm not).
Specifically, in the testcase here, the two specific subroutines have
argument lists like so:
+ subroutine with(i,*)
+ subroutine without()
These are distinguishable even if the alternate-return dummy argument is
ignored. The c.l.f. question applied to the more subtle case where the
second one has an argument list of "(i)", so the alternate-return is the
_only_ difference; that's why that case was arguably illegal.
So, yeah, the code in the testcase in your patch is completely valid.