public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/40551] Wrong code due to missing copy-in/copy-out stried array to assumed-size dummy
Date: Thu, 25 Jun 2009 15:43:00 -0000 [thread overview]
Message-ID: <20090625154302.13064.qmail@sourceware.org> (raw)
In-Reply-To: <bug-40551-13404@http.gcc.gnu.org/bugzilla/>
------- Comment #4 from burnus at gcc dot gnu dot org 2009-06-25 15:43 -------
(In reply to comment #3)
> Another example.
Which is invalid. Mea culpa:
"A procedure ... shall have an explicit interface if ... (3) The procedure has
a result that (a) is an array"
(That is something, -fwhole-file should be able to catch; currently it just
gives an ICE. I failed to find the restriction to specify dimension in F77, but
presumably I simply looked at the wrong place.)
I see three possibilities:
a) Returning a pointer instead of passing by the _result array descriptor by
reference. (As g95 does. Fix in caller+callee)
b) Doing the copy-in/copy-out in the called function (fix in callee)
c) Passing an array descriptor, but one which is contiguous (fix in caller)
d) Variant of A+C: Just pass a pointer and not an array descriptor the function
Notes:
(a) Means that there is only a single copy out. It will break the ABI, but
that's anyway planned.
(b) Means potentially many copy-in/copy-out. This might not be intended (some
people use automatic arrays vs. assumed-shape arrays on purpose to decide
whether a contiguous array or strides should be used - depending on the size
and what the function does, either is faster).
(c) Is a compromise - there is also only a single copy out.
(d) Is a variant of (a) and (c); it save some space but I think only for little
gain.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40551
next prev parent reply other threads:[~2009-06-25 15:43 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-25 13:30 [Bug fortran/40551] New: " burnus at gcc dot gnu dot org
2009-06-25 13:32 ` [Bug fortran/40551] " burnus at gcc dot gnu dot org
2009-06-25 14:22 ` dominiq at lps dot ens dot fr
2009-06-25 15:06 ` burnus at gcc dot gnu dot org
2009-06-25 15:43 ` burnus at gcc dot gnu dot org [this message]
2009-06-25 16:05 ` burnus at gcc dot gnu dot org
2009-06-28 20:31 ` pault at gcc dot gnu dot org
2009-06-29 9:21 ` pault at gcc dot gnu dot org
2009-06-29 15:19 ` pault at gcc dot gnu dot org
2009-06-29 20:39 ` pault at gcc dot gnu dot org
2009-06-30 6:24 ` pault at gcc dot gnu dot org
2009-07-05 19:06 ` pault at gcc dot gnu dot org
2009-07-07 12:47 ` burnus at gcc dot gnu dot org
2009-07-07 15:27 ` burnus at gcc dot gnu dot org
2009-07-09 17:06 ` [Bug fortran/40551] Optimizations possible using gfc_full_array_ref_p pault at gcc dot gnu dot org
2009-07-09 17:11 ` pault 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=20090625154302.13064.qmail@sourceware.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).