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: option to check that arguments to PACK conform?


On Fri, Nov 10, 2006 at 07:23:15PM +0100, Paul Thomas wrote:
> Steve,
> >FX and I briefly discussed this.  I think we want two functions.
> >In iresolve.c, we would have code of the form
> >
> >gfc_resolve_reshape(....) {
> >
> >    if (boundscheck) {
> >       Set up _gfortran_reshape_checking.  
> >    } else {
> >       Use current unchanged code _gfortran_reshape
> >    }
> >}
> >
> >The idea is that if the frontend needs to give the *_checking
> >routines additional info, we can do it like I did for rrspacing
> >and spacing.
> >
> >  
> I wonder if it would not be better to do the conformance checking in 
> trans-intrinsic.c(gfc_conv_intrinsic_function_call) itself; or in a 
> subsidiary function?
> 
> The reason that I suggest this is that it avoids any modifications to 
> the library, either by adding a conformance check flag to the arguments 
> or by doubling up of the library functions.
> 

In talking to FX, I got the the impression that it is
not always possible to do the checking in the frontend.
I don't remember the details and I can't find the email
exchange.

Are you proposing that in the presence of checking that
the frontend should emit a new function such that

   x = reshape(y,z)

becomes

  check_bounds(x, y, z)
  x = reshape(y,z)

-- 
Steve


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