public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pault at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/42112] overloaded function with allocatable result problem Date: Sun, 28 Nov 2010 12:46:00 -0000 [thread overview] Message-ID: <bug-42112-4-m9u3LxUlAy@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-42112-4@http.gcc.gnu.org/bugzilla/> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42112 --- Comment #8 from Paul Thomas <pault at gcc dot gnu.org> 2010-11-28 11:17:03 UTC --- Tobias, (In reply to comment #7) > (In reply to comment #6) > > One probably needs: > > > > a) If "a" is no TARGET: > > deallocate (a) > > f(&a) At present, this is not done. I guess that it has to be done by the caller, rather than the callee, simply because of the issue with TARGET below. > > ... which has with -fno-realloc-lhs issues when bound checking is enabled. (I > do not know whether we should care.) Surely, we should just not do the deallocate with -fno-realloc-lhs? > > > b) If "a" is a TARGET > > f(tmp) > > memcpy(a,tmp) > > ... while this one can be optimized with realloc-lhs to a deallocate + pointer > assignment if the size does not fit (rather than a malloc plus deep copying). I guess that this makes sense. It is very easily done. I'll put this on the TODO list, for fairly early implementation. I'll see what I can do with scalars, first. Paul
next prev parent reply other threads:[~2010-11-28 11:17 UTC|newest] Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-42112-4@http.gcc.gnu.org/bugzilla/> 2010-11-21 12:19 ` pault at gcc dot gnu.org 2010-11-25 8:02 ` pault at gcc dot gnu.org 2010-11-25 8:54 ` burnus at gcc dot gnu.org 2010-11-25 8:59 ` burnus at gcc dot gnu.org 2010-11-28 12:46 ` pault at gcc dot gnu.org [this message] 2015-04-17 17:49 ` dominiq at lps dot ens.fr 2015-08-07 20:46 ` mikael at gcc dot gnu.org 2009-11-19 22:20 [Bug fortran/42112] New: " mrestelli at gmail dot com 2009-11-19 23:56 ` [Bug fortran/42112] " kargl at gcc dot gnu dot org 2009-11-20 0:20 ` sgk at troutmask dot apl dot washington dot edu 2009-11-20 14:23 ` burnus 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=bug-42112-4-m9u3LxUlAy@http.gcc.gnu.org/bugzilla/ \ --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: linkBe 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).