From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2BF2B3858C50; Fri, 28 Apr 2023 00:34:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2BF2B3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682642081; bh=qnkmOk5hHob2hgJfFvS5KzZm43S4ioGM5/8zl8wVOFg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mt8bWPU/h74maWxOBrsXNXtLDIS0xtaazFGJd2GghZydfLL6ttbVuBk1VEGlmhta2 KIU4nuznAQSAvDzYOrsCGu6aYAcnyNfqVWUBlgtZc3wAz6pxO8i+LllDlRGZeJHtjk J5FjIUwmh8q7UnmEZEdrpP3pPjhATlrGHsOMcPQI= From: "adelson.oliveira at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109641] Gfortran fails to overload intrinsic operator (*) if operands are complex. It works with real ones. Date: Fri, 28 Apr 2023 00:34:38 +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: 10.1.0 X-Bugzilla-Keywords: accepts-invalid, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: adelson.oliveira at gmail dot com 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=3D109641 --- Comment #5 from Adelson Oliveira --- (In reply to anlauf from comment #2) > Replacing the first argument of >=20 > FUNCTION MULTc4(v,m) > REAL, INTENT(IN) :: v(:) >=20 > by >=20 > complex, INTENT(IN) :: v(:) >=20 > makes the code compile, but should not. And the fortran-dump appears to > explain why: we prematurely convert the first argument in the expression >=20 > r=3Dv*m >=20 > from real to complex, so we resolve to the wrong specific. > This also explains why real*real does not exhibit this problem. Interesting! But I wonder why simply changing the intrinsic operator (*) to something different, say (.MULT.) there is no error at all no matter one us= es complex or real.=