From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E0F8F3858C48; Mon, 17 Jun 2024 10:03:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E0F8F3858C48 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718618626; bh=uxe2Ai2EhkvgqpS4bNWCfj0NchMQBMcL1x8MBzY/vms=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cD8DCOUF+ozr+kLeWTis5RMMp0NUGVf0ijioQwbc6aO4LW7ci5nBDadQH+gjrx2NJ ZzojLmmo6OzVDGtFG9R0D7HqxiAIbPfIHv4wsAr8cQBoca8rUqOpehaAyyJ0apxatQ XX1eN7hFnwYNggAu0iwTGKAxAtXuQM43SaQDDcEQ= From: "mjr19 at cam dot ac.uk" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/107294] Missed optimization: multiplying real with complex number in Fortran (only) Date: Mon, 17 Jun 2024 10:03:44 +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: 11.3.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: mjr19 at cam dot ac.uk X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX 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: cc 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=3D107294 mjr19 at cam dot ac.uk changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mjr19 at cam dot ac.uk --- Comment #5 from mjr19 at cam dot ac.uk --- But 10.1.5.2.4 says "once the interpretation of a numeric intrinsic operati= on is established, the processor may evaluate any mathematically equivalent expression, provided that the integrity of parentheses is not violated." As cmplx(r)*z and cmplx(r*real(z),r*aimag(z)) are mathematically equivalent= , is a Fortran compiler not permitted to make this optimisation (unless conformi= ng to F90 or F95, for 10.1.5.2.4 was first introduced in F2003)? Furthermore, Fortran does not define how complex multiplication is to be performed, so relying on the precise details result when multiplying signed zeros or NaNs may be unwise.=