From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4780 invoked by alias); 13 Aug 2009 12:16:31 -0000 Received: (qmail 4422 invoked by uid 48); 13 Aug 2009 12:16:17 -0000 Date: Thu, 13 Aug 2009 12:16:00 -0000 Message-ID: <20090813121617.4421.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/40194] fortran rules for optimizing In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "matz 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: 2009-08/txt/msg01120.txt.bz2 ------- Comment #9 from matz at gcc dot gnu dot org 2009-08-13 12:16 ------- It is indeed somewhat related, but currently the patchset doesn't help here. The first issue is, that I create new types with unconflicting alias sets only for global variables, not local ones (as I1 is in this case). I believe I can change this meanwhile (the restriction came from earlier versions of the patch). But even if this is fixed we can't figure out the difference between INTENT(IN) and INTENT(OUT), i.e. even then we still believe that I1 can possibly be changed by the call. We have three ways out of this: 1) make the frontend not pass INTENT(IN) parameters by reference, maybe at least for scalars. That would be the preferred way, but unfortunately this probably would break a lot of code assuming such calling convention especially when interfacing with C code :-/ 2) invent a new attribute that we can attach to the individual arguments that would indicate non-clobbering via this reference 3) find a combination of existing things (DECL_BY_REFERENCE/TREE_READONLY/etc) that could be used by the middle end to conclude non-clobbering. Something like a const reference comes to mind, but unfortunately (the middle-end coming mostly from the C/C++ side) we don't conclude many interesting things about const refs/pointers. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40194