From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 444AF385781D; Sun, 15 Aug 2021 08:41:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 444AF385781D From: "rimvydas.jas at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/101918] New: LTO type mismatches for runtime library functions in mixed -fdefault-real-8 projects Date: Sun, 15 Aug 2021 08: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: 11.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rimvydas.jas 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 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: Sun, 15 Aug 2021 08:41:48 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101918 Bug ID: 101918 Summary: LTO type mismatches for runtime library functions in mixed -fdefault-real-8 projects Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: rimvydas.jas at gmail dot com Target Milestone: --- $ cat bar.f90 program bar implicit none logical :: mask(2,3) integer :: ai(2,3), vi(5) real :: ar(2,3), vr(2) double precision :: ad(2,3), vd(2) ai =3D 0 ai(1,1:2) =3D (/ 1, 2 /) ar =3D ai ad =3D ai mask =3D ai .ne. 0 vi =3D PACK(ai, ai .gt. 0, vector=3D(/1,2,3,4,5/)) vd =3D PACK(ad, mask) vr =3D PACK(ar, mask) call foo() end program $ cat foo.f90 subroutine foo implicit none real :: ar(2,3), v(1) ar =3D 0. ar(1,1) =3D 1. v =3D PACK(ar, ar > 0.) end subroutine $ gfortran -Wall -Wextra -flto -fdefault-real-8 -c foo.f90 $ gfortran -flto -Wall -Wextra foo.o bar.f90 bar.f90:14:19: warning: type of '_gfortran_pack' does not match original declaration [-Wlto-type-mismatch] 14 | vr =3D PACK(ar, mask) | ^ bar.f90:13:19: warning: type of '_gfortran_pack' does not match original declaration [-Wlto-type-mismatch] 13 | vd =3D PACK(ad, mask) | ^ bar.f90:12:46: warning: type of '_gfortran_pack' does not match original declaration [-Wlto-type-mismatch] 12 | vi =3D PACK(ai, ai .gt. 0, vector=3D(/1,2,3,4,5/)) | ^ foo.f90:6:21: note: '_gfortran_pack' was previously declared here 6 | v =3D PACK(ar, ar > 0.) | ^ foo.f90:6:21: note: code may be misoptimized unless '-fno-strict-aliasing' = is used In medium sized mixed C/Fortran codebase there are more instances for: _gfortran_matmul_r8 _gfortran_pack _gfortran_reshape_r8 _gfortran_set_convert _gfortran_shape_4 _gfortran_unpack0 _gfortran_unpack1 Does this mean -flto cannot be used in mixed -fdefault-real-8 and usual mod= es?=