From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4281 invoked by alias); 23 Feb 2005 14:29:13 -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 3885 invoked by uid 48); 23 Feb 2005 14:28:58 -0000 Date: Wed, 23 Feb 2005 18:21:00 -0000 From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050223142857.20165.pinskia@gcc.gnu.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/20165] New: Pointer does not really escape with write X-Bugzilla-Reason: CC X-SW-Source: 2005-02/txt/msg02809.txt.bz2 List-Id: Take the following fortran code (were we know that write does not make the pointer escape): program main dimension x(10) write(3)n,(x(n),n=1,10) end in the last tree dump we get: _gfortran_transfer_integer (&n, 4); n = 1; :; _gfortran_transfer_real (&x[n + -1], 4); n.3 = n; n = n.3 + 1; if (n.3 == 10) goto ; else goto ; See how n is marked as not a gimple variable which causes us to store it on the stack. Even though we know that _gfortran_transfer_real will not cause the pointer to escape. There should be a new attribute to mark functions as causing pointers not to escape at all. -- Summary: Pointer does not really escape with write Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20165