public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/108349] New: LTO mismatch for __builtin_realloc between glibc and gfortran frontend
@ 2023-01-10  9:28 rimvydas.jas at gmail dot com
  2023-01-10  9:48 ` [Bug fortran/108349] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: rimvydas.jas at gmail dot com @ 2023-01-10  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-05-04  7:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-10  9:28 [Bug fortran/108349] New: LTO mismatch for __builtin_realloc between glibc and gfortran frontend rimvydas.jas at gmail dot com
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

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).