From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8713C3858CDA; Tue, 10 Jan 2023 09:28:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8713C3858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673342882; bh=Sne7FAKcBTnBToi0bSPeCEnjzMwVvw64R2PyTFjouEc=; h=From:To:Subject:Date:From; b=gETODkVd5tiT1Jl4lX/Yx4U8kmTq2ZrQQEhkvsbsE09gZHJN+Mm3ZNunt2oLIkjkq nRp4tf/thslvQNuWpTW8+vxSc8I66a/Vqh00Ib96R9hMLd2kcxJhSJSJI661QPECxf kfMbj0VuFcZoo5b/xvRaODz/qsUCWaWsDefluHXo= From: "rimvydas.jas at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/108349] New: LTO mismatch for __builtin_realloc between glibc and gfortran frontend Date: Tue, 10 Jan 2023 09:28:01 +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: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D108349 Bug ID: 108349 Summary: LTO mismatch for __builtin_realloc between glibc and gfortran frontend Product: gcc Version: 13.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 foo.f90 program foo end program module buffer integer,allocatable :: mpi_ids(:) contains subroutine method(ids) integer,intent(in) :: ids(:) mpi_ids=3Dids end subroutine end module $ cat bar.c #include "stdlib.h" void bar(void *ptr){ptr =3D realloc(ptr,6);} $ gfortran -flto foo.f90 bar.c # no warning given $ gfortran -flto bar.c foo.f90 : warning: type of =E2=80=98__builtin_realloc=E2=80=99 does not m= atch original declaration [-Wlto-type-mismatch] /usr/include/stdlib.h:564:14: note: type mismatch in parameter 1 564 | extern void *realloc (void *__ptr, size_t __size) | ^ /usr/include/stdlib.h:564:14: note: =E2=80=98realloc=E2=80=99 was previousl= y declared here /usr/include/stdlib.h:564:14: note: code may be misoptimized unless =E2=80=98-fno-strict-aliasing=E2=80=99 is used Why diagnostic is given depending on sources (or objects) order? No diagnostic is provided if type arguments are swapped in gcc/fortran/f95-lang.cc:996=