public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rimvydas.jas at gmail dot com" <gcc-bugzilla@gcc.gnu.org> 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 [thread overview] Message-ID: <bug-108349-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108349 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=ids end subroutine end module $ cat bar.c #include "stdlib.h" void bar(void *ptr){ptr = realloc(ptr,6);} $ gfortran -flto foo.f90 bar.c # no warning given $ gfortran -flto bar.c foo.f90 <built-in>: warning: type of ‘__builtin_realloc’ does not match 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: ‘realloc’ was previously declared here /usr/include/stdlib.h:564:14: note: code may be misoptimized unless ‘-fno-strict-aliasing’ 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
next reply other threads:[~2023-01-10 9:28 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-10 9:28 rimvydas.jas at gmail dot com [this message] 2023-01-10 9:48 ` [Bug fortran/108349] " rguenth at gcc dot gnu.org 2023-01-10 10:14 ` jakub at gcc dot gnu.org 2023-01-10 10:20 ` jakub at gcc dot gnu.org 2023-01-10 11:11 ` jakub at gcc dot gnu.org 2023-01-11 9:42 ` cvs-commit at gcc dot gnu.org 2023-01-11 14:03 ` tschwinge at gcc dot gnu.org 2023-02-10 17:45 ` cvs-commit at gcc dot gnu.org 2023-05-02 20:13 ` cvs-commit at gcc dot gnu.org 2023-05-03 15:20 ` cvs-commit at gcc dot gnu.org 2023-05-04 7:23 ` jakub at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108349-4@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).