From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9C9F5385842E; Tue, 22 Mar 2022 11:20:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C9F5385842E From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/105012] [12 Regression] wrf from SPECCPU2017 ICEs during LTO linking since r12-7692-g8db155ddf8cec9 Date: Tue, 22 Mar 2022 11:20:59 +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: 12.0 X-Bugzilla-Keywords: ice-on-valid-code, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 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 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, 22 Mar 2022 11:20:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105012 --- Comment #11 from Richard Biener --- (In reply to Richard Biener from comment #10) > likely triggered by the INTENT(out), it looks like gfortran fails to prop= erly > name-lookup a variable of the same name as the function? The intent is > likely > to have the return value assigned by CALERF_r8. So it also looks like > gfortran miscompiles such testcase. >=20 > The following sketches a miscompiled testcase (but my fortran fu is too w= eak > to make it compile) >=20 > PROCEDURE Y (Z) > real(8), intent(out) :: Z > Z =3D 1. > END PROCEDURE Y > FUNCTION X > real(8) :: X > CALL Y (X) > END FUNCTION X > PROGRAM TEST > real(8) :: Z > Z =3D X(); > if (Z.ne.1.) STOP 1 > END SUBROUTINE Y (Z) real(8), intent(out) :: Z Z =3D 1. END SUBROUTINE Y FUNCTION X() real(8) :: X CALL Y (X) END FUNCTION X PROGRAM TEST real(8) :: Z Z =3D X(); if (Z.ne.1.) STOP 1 END PROGRAM but still t.f90:11:9: 11 | Z =3D X(); | 1 Error: Return type mismatch of function 'x' at (1) (REAL(4)/REAL(8))=