From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B00DD3858C2C; Sun, 27 Nov 2022 21:24:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B00DD3858C2C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669584297; bh=JKNT3oG9VLTTmRJWB/8ErugVgyczba8jDyDgO+2xQKw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=GagYmppyuZHPOKK2J8OnqNRPneTv6QgnrFboIym9HditLpxMsFXR1JARvb+ny4Ktm riUqRXEVlT6G+V3nreRM0BonpVoqgju2Vl5WnNmaWN2g/Ji1Y141WuSPP8a+ki6/GC 9Hzo4d0gpNhzE/JmEssU6Gk1Z9qfxwJEJqSfUrWc= From: "sgk at troutmask dot apl.washington.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107874] merge not using all its arguments Date: Sun, 27 Nov 2022 21:24:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: sgk at troutmask dot apl.washington.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107874 --- Comment #5 from Steve Kargl -= -- On Sun, Nov 27, 2022 at 08:00:35PM +0000, anlauf at gcc dot gnu.org wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107874 >=20 > --- Comment #3 from anlauf at gcc dot gnu.org --- > (In reply to kargl from comment #2) > > Harald, you are likely right the patch can be moved down. I'll program= med > > up the example from the Fortran 2018 standard, which works as expected.= So, > > there is definitely something about a scalar mask choosing the actual > > argument before both are evaluated. > >=20 > > program foo >=20 > Steve, >=20 > this example from the standard seems to be working down to 7.5 for me. > Am I missing something? Do we need this in the testsuite? You are not missing anything. I wanted an example that works with or without the patch John included, so that we don't=20 accidently introduce a regression. > I'd say it's rather the following two lines replacing the loop in the > reproducer in comment#0: >=20 > print *, merge(tstuff(),fstuff(),.true.) > print *, merge(tstuff(),fstuff(),.false.) >=20 > This is mis-simplified in simplify.cc:4909 Good find! This may indeed be a source of the issue.=