From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11341 invoked by alias); 6 Apr 2010 13:30:25 -0000 Received: (qmail 10998 invoked by uid 48); 6 Apr 2010 13:29:51 -0000 Date: Tue, 06 Apr 2010 13:30:00 -0000 Subject: [Bug fortran/43665] New: Optimization of libgfortran calls: function annotations for noclobber/noescape arguments X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2010-04/txt/msg00556.txt.bz2 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