public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "kargl at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/114021] New: ICE with allocation of scalar pointer entity where SOURCE=f() with f() returning a pointer Date: Tue, 20 Feb 2024 21:02:45 +0000 [thread overview] Message-ID: <bug-114021-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114021 Bug ID: 114021 Summary: ICE with allocation of scalar pointer entity where SOURCE=f() with f() returning a pointer Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: kargl at gcc dot gnu.org Target Milestone: --- Note sure if this is legal Fortran, but it leads to an ICE. Reduced testcase from Fujitsu testsuite. ! ! https://github.com/fujitsu/compiler-test-suite ! Reduced from 0077/0077_0005.f90 ! module m1 type y integer, allocatable:: x1(:) end type type(y), target :: w integer :: c = 0 contains function f() type(y), pointer :: f f => w c = c + 1 end function end subroutine s2 use m1 ! type(y), allocate :: x ! This ICEs as well type(y), pointer :: x allocate(x, source = f()) end use m1 call s2 if (c /= 1) stop end % gfcx -o z 0077/0077_0005.f90 0077/0077_0005.f90:21:28: 21 | allocate(x, source = f()) | 1 internal compiler error: Segmentation fault 0x109b292 crash_signal ../../gccx/gcc/toplev.cc:317 0x2470c137f handle_signal /usr/src/lib/libthr/thread/thr_sig.c:301 0x2470c09b7 thr_sighandler /usr/src/lib/libthr/thread/thr_sig.c:244 0xacea7d tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gccx/gcc/tree.h:3611 0xacea7d gfc_trans_allocate(gfc_code*, gfc_omp_namelist*) ../../gccx/gcc/fortran/trans-stmt.cc:6672
reply other threads:[~2024-02-20 21:02 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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-114021-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).