[Bug fortran/43665] New: Optimization of libgfortran calls: function annotations for noclobber/noescape arguments

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Apr 6 13:30:00 GMT 2010


After the support goes into the middle end, cf.
http://gcc.gnu.org/ml/fortran/2010-04/msg00012.html and
http://gcc.gnu.org/ml/gcc-patches/2009-11/msg01257.html , one should use the
the new function call argument/return value attributes.

Note: One needs to be careful about this in terms of multi-image coarrays (SYNC
ALL, array single-side access) and true asynchronous I/O (WRITE ... WAIT) as
otherwise the middle end optimizes too much. (Telling this the middle end via a
specifically tailored attribute might be better, though.)

+ /* Call argument flags.  */
+ 
+ /* Nonzero if the argument is not dereferenced recursively, thus only
+    directly reachable memory is read or written.  */
+ #define EAF_DIRECT            (1 << 0)
+ /* Nonzero if memory reached by the argument is not clobbered.  */
+ #define EAF_NOCLOBBER         (1 << 1)
+ /* Nonzero if the argument does not escape.  */
+ #define EAF_NOESCAPE          (1 << 2)
+ /* Nonzero if the argument is not used by the function.  */
+ #define EAF_UNUSED            (1 << 3)
+
+ /* Call return flags.  */
+ 
+ /* Mask for the argument number that is returned.  Lower two bits of
+    the return flags, encodes argument slots zero to three.  */
+ #define ERF_RETURN_ARG_MASK   (3)
+ /* Nonzero if the return value is equal to the argument number
+    flags & ERF_RETURN_ARG_MASK.  */
+ #define ERF_RETURNS_ARG               (1 << 2)
+ /* Nonzero if the return value does not alias with anything.  Functions
+    with the malloc attribute have this set on their return value.  */
+ #define ERF_NOALIAS           (1 << 3)


-- 
           Summary: Optimization of libgfortran calls: function annotations
                    for noclobber/noescape arguments
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43665



More information about the Gcc-bugs mailing list