public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "sgk at troutmask dot apl.washington.edu" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/100440] allocated() gives True for unallocated variable Date: Fri, 07 May 2021 21:58:10 +0000 [thread overview] Message-ID: <bug-100440-4-AyTATIPw7i@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-100440-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100440 --- Comment #7 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Fri, May 07, 2021 at 09:12:15PM +0000, anlauf at gcc dot gnu.org wrote: > --- Comment #6 from anlauf at gcc dot gnu.org --- > There seems to be something fishy with default initialization of function > results of derived types. There is no default initialization in the code below. default initialization is type foo integer :: i = 1 ! <-- Default initialization end tyep foo > Looking at the attached code, I guessed the > following potential reproducer: > > program p > implicit none > type multi > real, allocatable :: mp(:) > end type > type fm > type(multi) :: mfm > end type > type(fm), allocatable :: a(:,:) > integer :: n = 1 > allocate (a(n,n)) > a = mm (a, a) > a = mm (a, a) ! crashes here with -fsanitize=address > contains > function mm (ma, mb) > type(fm) :: ma(:,:), mb(:,:) > type(fm), dimension(size(ma,dim=1),size(mb,dim=2)) :: mm So, it is the size(ma,dim=1) and size(mb,dim=2) that are causing the problem.
next prev parent reply other threads:[~2021-05-07 21:58 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-05-05 23:11 [Bug fortran/100440] New: " dsmith at lmu dot edu 2021-05-06 0:22 ` [Bug fortran/100440] " kargl at gcc dot gnu.org 2021-05-06 21:31 ` David.Smith at lmu dot edu 2021-05-06 22:54 ` sgk at troutmask dot apl.washington.edu 2021-05-07 14:49 ` David.Smith at lmu dot edu 2021-05-07 21:09 ` kargl at gcc dot gnu.org 2021-05-07 21:12 ` anlauf at gcc dot gnu.org 2021-05-07 21:58 ` sgk at troutmask dot apl.washington.edu [this message] 2021-05-08 17:21 ` David.Smith at lmu dot edu 2021-05-08 18:49 ` anlauf at gcc dot gnu.org 2021-05-09 0:32 ` sgk at troutmask dot apl.washington.edu 2021-05-11 19:56 ` anlauf at gcc dot gnu.org 2021-05-11 20:23 ` anlauf at gcc dot gnu.org 2021-07-26 16:45 ` David.Smith at lmu dot edu
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-100440-4-AyTATIPw7i@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).