From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30090 invoked by alias); 9 Oct 2005 17:41:46 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 29889 invoked by uid 48); 9 Oct 2005 17:41:43 -0000 Date: Sun, 09 Oct 2005 17:41:00 -0000 Message-ID: <20051009174143.29888.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/23169] INTENT information not used in the middle-end for optimizations In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" X-SW-Source: 2005-10/txt/msg01091.txt.bz2 List-Id: ------- Comment #4 from pinskia at gcc dot gnu dot org 2005-10-09 17:41 ------- There are a couple of problems here. First I noticed that bar in foo is not marked as pure even though the IPA mechanism marked it as such, so that looks like a fortran front-end bug in that it has two different DECLs for the same function. The second issue after that is filed as PR 24287 which talks about pure functions causing local variables to be call clobbered even though they don't escape. This issue is related to PR 23134 also. Here is a testcase which we would not get unless we take intent(in) into account: integer function foo(b,c) integer, intent(in) :: b, c integer :: d, e d = b; e = c; call bar(b,c) foo = d-b + e-c; end function foo should always be zero as bar should not be able to touch b or c. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23169