public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/20165] New: Pointer does not really escape with write
Date: Wed, 23 Feb 2005 18:21:00 -0000	[thread overview]
Message-ID: <20050223142857.20165.pinskia@gcc.gnu.org> (raw)

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;

<L0>:;
  _gfortran_transfer_real (&x[n + -1], 4);
  n.3 = n;
  n = n.3 + 1;
  if (n.3 == 10) goto <L4>; else goto <L0>;

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


             reply	other threads:[~2005-02-23 14:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-23 18:21 pinskia at gcc dot gnu dot org [this message]
2005-02-23 23:29 ` [Bug tree-optimization/20165] " pinskia at gcc dot gnu dot org
2005-03-01 18:12 ` pinskia at gcc dot gnu dot org
2005-08-31 15:09 ` dberlin at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050223142857.20165.pinskia@gcc.gnu.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).