This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [G95] modification of array argument passing
- From: Paul Brook <paul at nowt dot org>
- To: zhao ke <kejia_zh at yahoo dot com dot cn>, fortran at gcc dot gnu dot org
- Date: Thu, 20 Nov 2003 12:40:42 +0000
- Subject: Re: [G95] modification of array argument passing
- References: <20031119113248.75368.qmail@web15309.mail.bjs.yahoo.com>
Wrong list, please use fortran@gcc.gnu.org for queries concerning gfortran
(redirected).
On Wednesday 19 November 2003 11:32 am, zhao ke wrote:
> The attach is the modification code of my suggestion. Would you please
> check if they are suitable?
This sounds a reasonable proposal. AFAIK it matches the behaviour of
existing compilers, so code is likley to be optimized for this behavior.
The patch is ok in principle, bit I have issues wtith the implementation:
! f = formal ? (!formal->sym->attr.pointer
! && formal->sym->as->type != AS_ASSUMED_SHAPE)
! : 0;
! g77 = sym->attr.always_explicit ? g77 && f : 1;
This is just plain obfuscation. There's no reason to use conditional
expressions. It should be written something like this:
g77 = (g77 && f) || !sym->attr.always_explcit
A short comment explaining when an array descriptor is used would also be
nice. The above logic is certainly not immediately obvious.
Paul