From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 775483847807; Tue, 10 Aug 2021 08:11:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 775483847807 From: "jellby at yahoo dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/101841] New: Wrong realloc-lhs warning with matmul and -O2 Date: Tue, 10 Aug 2021 08:11:22 +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: 10.3.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jellby at yahoo 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 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2021 08:11:22 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101841 Bug ID: 101841 Summary: Wrong realloc-lhs warning with matmul and -O2 Product: gcc Version: 10.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: jellby at yahoo dot com Target Milestone: --- I get a warning with this: program test real, allocatable :: F(:,:), A(:,:), B(:,:) allocate(F(10,10), A(10,10), B(10,10)) F(:,:) =3D 1.0 A(:,:) =3D 0.5 B(:,:) =3D 2.0 F(:,:) =3D F-matmul(a,b) end program test $ gfortran test.f90 -Wrealloc-lhs -O2 No warning with "F(:,:) =3D matmul(a,b)" Maybe the warning means that a temporary array is created (although I guess= it wouldn't be needed)? But as far as I can see there should be no reallocation here.=