public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marcel.jacobse at ewetel dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/101135] New: Use of absent assumed-shape array argument as an actual argument for an optional dummy argument mistakenly flagged as error by UndefinedBehaviourSanitizer Date: Sat, 19 Jun 2021 12:49:23 +0000 [thread overview] Message-ID: <bug-101135-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101135 Bug ID: 101135 Summary: Use of absent assumed-shape array argument as an actual argument for an optional dummy argument mistakenly flagged as error by UndefinedBehaviourSanitizer Product: gcc Version: 11.1.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: marcel.jacobse at ewetel dot net Target Milestone: --- Compiling and running the minimal example program main implicit none call test_wrapper contains subroutine test_wrapper(y) real, dimension(1), intent(out), optional :: y call test(y) end subroutine test_wrapper subroutine test(y) real, dimension(:), intent(out), optional :: y if (present(y)) y=0 end subroutine test end program with -fsanitize=undefined on any gfortran version since 8.1.0 produces this false positive: /app/example.f90:8:20: runtime error: load of null pointer of type 'real(kind=4)' See for example: https://godbolt.org/z/aqGE18EGG The issue disappears on gfortran version 7.3.0 and earlier, and also if 'y' in 'test' is not an assumed-shape array, for example if replacing 'dimension(:)' by 'dimension(1)'. See also https://stackoverflow.com/questions/68046152/is-passing-an-absent-assumed-shape-array-for-an-optional-argument-of-another-pro Unfortunately I am not sure if this is an issue with gfortran itself or moreso a false positive by UndefinedBehaviourSanitizer. So perhaps this report should rather be for the "sanitizer" component, sorry if that is the case.
next reply other threads:[~2021-06-19 12:49 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-06-19 12:49 marcel.jacobse at ewetel dot net [this message] 2021-06-26 1:07 ` [Bug fortran/101135] " marcel.jacobse at ewetel dot net 2021-06-26 13:20 ` marcel.jacobse at ewetel dot net 2022-01-27 20:38 ` [Bug fortran/101135] Load of null pointer when passing absent assumed-shape array argument for an optional dummy argument anlauf at gcc dot gnu.org 2022-01-28 22:22 ` anlauf at gcc dot gnu.org 2022-01-29 21:43 ` anlauf at gcc dot gnu.org 2022-01-31 20:49 ` anlauf at gcc dot gnu.org 2024-03-17 21:42 ` cvs-commit at gcc dot gnu.org 2024-03-23 20:13 ` cvs-commit at gcc dot gnu.org 2024-03-23 20:14 ` anlauf at gcc dot gnu.org 2024-03-23 21:01 ` marcel.jacobse at ewetel dot net
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-101135-4@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).