This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [patch, fortran] annotate library calls, part 1


On Wed, May 12, 2010 at 8:52 PM, Daniel Franke <franke.daniel@gmail.com> wrote:
>
> Attached patch annotates the library calls in trans-decl.c and trans-io.c with
> noclobber/noescape attributes. That is, those in trans-io are dummies only,
> literally just "....", so somebody who knows the internals can fill them in
> easily wherever feasible.
>
> That leaves the intrinsic and external procedure calls to be done.
> I assume that it was meant that the INTENT information is used for that?
> Probably: INTENT(in) -> 'r'; INTENT(out) -> 'w'; INTENT(inout) -> '.'?

Both r and w specify that the argument does not escape through the
function call.  That would be only correct if the argument does not
have target or pointer attribute(?)  Note that 'w' or 'W' are effectively
INTENT(inout), as modification implies use (we could add another
variant though, but if the parameter is an array descriptor even for
INTENT(out) we need to be able to read the descriptor itself).

There is no separate read-only (or even a write-only) flag (yet).
Usually those without non-escape do not make much sense as
subsequent calls then need to be considered modifying the
escaped objects.

Richard.

>
> 2010-05-12 ?Daniel Franke ?<franke.daniel@gmail.com>
>
> ? ? ? ?PR fortran/43665
> ? ? ? ?* trans.h (gfc_build_library_function_decl_with_spec): New prototype.
> ? ? ? ?* trans-decl.c (gfc_build_library_function_decl_with_spec): Removed
> ? ? ? ?static.
> ? ? ? ?(gfc_build_intrinsic_function_decls): Add noclobber/noescape
> ? ? ? ?annotations to function calls.
> ? ? ? ?(gfc_build_builtin_function_decls): Likewise.
> ? ? ? ?* trans-io (gfc_build_io_library_fndecls): Add dummy annotations.
>
>
> Regression tested on i686-pc-linux-gnu. No immediate desaster.
> Ok for trunk?
>
> ? ? ? ?Daniel
>


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