public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/99169] New: Segfault when passing allocatable scalar into intent(out) dummy argument
@ 2021-02-19 17:31 townsend at astro dot wisc.edu
  2021-02-19 19:49 ` [Bug fortran/99169] [9/10/11 Regression] " anlauf at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: townsend at astro dot wisc.edu @ 2021-02-19 17:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99169
           Summary: Segfault when passing allocatable scalar into
                    intent(out) dummy argument
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: townsend at astro dot wisc.edu
  Target Milestone: ---

Created attachment 50222
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50222&action=edit
Minimal working example

I've encountered a problem when passing an allocatable (and alread allocated)
scalar as an actual argument to a procedure with an intent(out) (but not
allocatable) dummy argument. The attached code illustrates the problem. 

Compiling with gfortran 10.2.0 at optimization level -O1 or -O2 leads to a
segmentation fault at runtime. The segfault arises when the dummy is assigned
within set_i(). This problem does not arise at optimization level -O0, and the
program performs as expected (outputting '5' to the terminal).

The problem also seems to disappear when set_i() is a CONTAINed procedure in
the main program, rather than a module procedure.

cheers,

Rich

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-09-25 12:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19 17:31 [Bug fortran/99169] New: Segfault when passing allocatable scalar into intent(out) dummy argument townsend at astro dot wisc.edu
2021-02-19 19:49 ` [Bug fortran/99169] [9/10/11 Regression] " anlauf at gcc dot gnu.org
2021-02-19 19:58 ` anlauf at gcc dot gnu.org
2021-02-19 20:13 ` anlauf at gcc dot gnu.org
2021-02-19 20:20 ` anlauf at gcc dot gnu.org
2021-02-19 21:17 ` anlauf at gcc dot gnu.org
2021-02-21 20:44 ` cvs-commit at gcc dot gnu.org
2021-02-23 18:14 ` cvs-commit at gcc dot gnu.org
2021-02-23 18:27 ` cvs-commit at gcc dot gnu.org
2021-02-23 18:29 ` anlauf at gcc dot gnu.org
2022-09-25 12:48 ` cvs-commit at gcc dot gnu.org

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).