From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 11B763858D3C; Thu, 27 Apr 2023 01:41:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 11B763858D3C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1682559709; bh=gT1N5YZTxi4LDaPnnnm/MEQdn9lNi37s8+A4Mg5nYSI=; h=From:To:Subject:Date:From; b=K6KMZSeRUI6tua5YrrmCJy3MlOw1/ICL8UUVPBcz/STlATgWqSdw3ilJMJhL4IIJS yfL2IA/G4aAmBWkLq95BHxIiLTe0++6EaZw0OkonR0/ic5opnhA6qoi2q7CSL8AJIy 4uyXmHqdFLxvYkj4j7pg6wSWPDzDB4THsALSOXVo= From: "adelson.oliveira at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/109641] New: Gfortran fails to overload intrinsic operator (*) if operands are complex. It works with real ones. Date: Thu, 27 Apr 2023 01:41:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: og10 (devel/omp/gcc-10) X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: adelson.oliveira at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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 Bug ID: 109641 Summary: Gfortran fails to overload intrinsic operator (*) if operands are complex. It works with real ones. Product: gcc Version: og10 (devel/omp/gcc-10) Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: adelson.oliveira at gmail dot com Target Milestone: --- Created attachment 54929 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D54929&action=3Dedit A small FORTRAN code to reproduce the bug I'm uploading a small fortran code to show the problem. The code has a modu= le that overloads intrinsic operator (*) for a vector matrix multiplication. T= he bug is triggered when the matrix (and the result) is complex. The compilation with $ gfortran -o teste -O teste.f90 will fail with a error message reporting inconsistent rank declaration. As indicated in the snippet, simply changing from COMPLEX to REAL in the declaration of the matrix (and the result) everything goes fine. As an additional information, if one changes from the intrinsic (*) to something like (.MULT.) in the module then there is no error at all. Please look for the comments in the MODULE TESTEOP and in the PROGRAM TESTE= to better test the bug. Thanks for any help=