public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "xudong.luo@compiler-dev.com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/105371] New: The result of the merge function is different when it's type of parameters is the extensions type of derived type Date: Mon, 25 Apr 2022 00:56:59 +0000 [thread overview] Message-ID: <bug-105371-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105371 Bug ID: 105371 Summary: The result of the merge function is different when it's type of parameters is the extensions type of derived type Product: gcc Version: 11.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: xudong.luo@compiler-dev.com Target Milestone: --- Created attachment 52862 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52862&action=edit output Whether the mask is a constant or a variable causes inconsistent results of the merge function when it's type of parameters is the extensions type of derived type. 1.The mask is constant Program test00 Type t Integer :: c End Type Type,Extends(t) :: t2 Integer :: c2 End Type Class(t),Allocatable :: x,y,r logical :: ok = .true. x = t2(1,-1) y = t2(2,-2) r = merge (x,y,.true.) Select Type (z=>r) Type Is (t) print *,z%c Type Is (t2) print *,z%c,z%c2 End Select End Program 2. The mask is variable Program test01 Type t Integer :: c End Type Type,Extends(t) :: t2 Integer :: c2 End Type Class(t),Allocatable :: x,y,r logical :: ok = .true. integer :: i = 1 x = t2(1,-1) y = t2(2,-2) r = merge (x,y,i == 1) Select Type (z=>r) Type Is (t) print *,z%c Type Is (t2) print *,z%c,z%c2 End Select End Program
next reply other threads:[~2022-04-25 0:56 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-04-25 0:56 xudong.luo@compiler-dev.com [this message] 2022-04-25 7:03 ` [Bug fortran/105371] " schwab@linux-m68k.org 2022-04-26 18:12 ` kargl at gcc dot gnu.org 2022-04-27 9:28 ` xudong.luo@compiler-dev.com 2022-04-27 19:51 ` anlauf at gcc dot gnu.org 2022-04-27 22:14 ` sgk at troutmask dot apl.washington.edu 2022-04-28 0:10 ` xudong.luo@compiler-dev.com 2022-04-28 7:00 ` xudong.luo@compiler-dev.com 2022-10-10 19:28 ` anlauf 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-105371-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).