public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/93925] Invalid memory reference upon call of a routine taking a procedure pointer as argument
Date: Mon, 25 Jan 2021 20:04:55 +0000	[thread overview]
Message-ID: <bug-93925-4-4GxAAXp0yb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-93925-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93925

Thomas Koenig <tkoenig at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu.org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---
The test case violates, 15.5.2.4  Ordinary dummy variables, subsection 11
of the F2018 standard:

If the dummy argument has the TARGET attribute and the effective argument
does not have the TARGET attribute or is an array section with a vector
subscript, any pointers associated with the dummy argument
become undefined when execution of the procedure completes.

fun returns an undefined pointer, so anything can happen (including
a segfault).

nagfor catches this, by the way:

Runtime Error: 93925.f90, line 36: Reference to dangling pointer P
Target was RETURNed from procedure F

       reply	other threads:[~2021-01-25 20:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-93925-4@http.gcc.gnu.org/bugzilla/>
2021-01-25 20:04 ` tkoenig at gcc dot gnu.org [this message]
2021-01-26  5:57 ` mscfd at gmx dot net
2021-01-26  5:58 ` mscfd at gmx dot net
2021-01-26  5:59 ` mscfd at gmx dot net
2021-01-26  5:59 ` mscfd at gmx dot net
2021-01-26  6:48 ` tkoenig at gcc dot gnu.org
2021-01-27 11:16 ` pault at gcc dot gnu.org
2021-01-27 11:34 ` cvs-commit at gcc dot gnu.org
2021-05-04 12:32 ` rguenth at gcc dot gnu.org
2021-08-28 19:57 ` cvs-commit at gcc dot gnu.org
2021-08-28 19:58 ` anlauf at gcc dot gnu.org
2021-09-06 18:43 ` cvs-commit at gcc dot gnu.org
2021-09-06 18:48 ` anlauf at gcc dot gnu.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-93925-4-4GxAAXp0yb@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: 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).