This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [G95] modification of array argument passing


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


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