public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dominiq at lps dot ens.fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/65792] allocation of scalar elemental function with structure constructor fails
Date: Fri, 17 Apr 2015 22:48:00 -0000	[thread overview]
Message-ID: <bug-65792-4-bWQOP7XLT7@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-65792-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
> Created attachment 35346 [details]
> draft patch, untested

The patch fixes the PR, but causes

FAIL: gfortran.dg/class_19.f03   -O0  execution test
FAIL: gfortran.dg/class_19.f03   -O1  execution test
FAIL: gfortran.dg/class_19.f03   -O2  execution test
FAIL: gfortran.dg/class_19.f03   -O3 -fomit-frame-pointer  execution test
FAIL: gfortran.dg/class_19.f03   -O3 -fomit-frame-pointer -funroll-loops 
execution test
FAIL: gfortran.dg/class_19.f03   -O3 -fomit-frame-pointer -funroll-all-loops
-finline-functions  execution test
FAIL: gfortran.dg/class_19.f03   -O3 -g  execution test
FAIL: gfortran.dg/class_19.f03   -Os  execution test
FAIL: gfortran.dg/class_19.f03   -g -flto  execution test

reduced test

module foo_mod
  type foo_inner
    integer, allocatable :: v(:)
  end type foo_inner
  type foo_outer
    class(foo_inner), allocatable :: int
  end type foo_outer
contains
subroutine foo_checkit()
  implicit none
  type(foo_outer),allocatable :: try2

  allocate(try2)
  if (allocated(try2%int)) call abort()

end subroutine foo_checkit
end module foo_mod

program main

  use foo_mod
  implicit none

  call foo_checkit()

end program main

which gives at run time

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.


  parent reply	other threads:[~2015-04-17 22:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-17 12:40 [Bug fortran/65792] New: " dominiq at lps dot ens.fr
2015-04-17 19:33 ` [Bug fortran/65792] " mikael at gcc dot gnu.org
2015-04-17 20:16 ` mikael at gcc dot gnu.org
2015-04-17 22:48 ` dominiq at lps dot ens.fr [this message]
2015-04-17 22:49 ` dominiq at lps dot ens.fr
2015-04-18  7:48 ` dominiq at lps dot ens.fr
2015-04-18  9:03 ` mikael at gcc dot gnu.org
2015-04-18  9:15 ` mikael at gcc dot gnu.org
2015-04-18 11:10 ` dominiq at lps dot ens.fr
2015-04-25 22:40 ` pault at gcc dot gnu.org
2015-07-25 19:48 ` mikael 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-65792-4-bWQOP7XLT7@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).