public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/101917] New: Spurious -Wstringop-overread with -flto when passing zero sized arrays
@ 2021-08-15  8:40 rimvydas.jas at gmail dot com
  2021-11-10  4:48 ` [Bug middle-end/101917] [11 Regression] " msebor at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rimvydas.jas at gmail dot com @ 2021-08-15  8:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101917

            Bug ID: 101917
           Summary: Spurious -Wstringop-overread with -flto when passing
                    zero sized arrays
           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.c
void bar_(const int flag[], const int *num) { }

$ cat foo.f90
program foo
integer :: idummy(0)
call bar(idummy, 0)
end program

$ gcc -flto -c bar.c
$ gfortran -Wall -Wextra -flto -c foo.f90
$ gfortran -Wall -Wextra -flto foo.o bar.o
foo.f90: In function 'foo':
foo.f90:3:19: warning: 'bar_' reading 4 bytes from a region of size 0
[-Wstringop-overread]
    3 | call bar(idummy, 0)
      |                   ^
foo.f90:3:19: note: referencing argument 1 of type 'const int *'
bar.c:1:6: note: in a call to function 'bar_'
    1 | void bar_(const int flag[], const int *num) { }
      |      ^

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

end of thread, other threads:[~2023-05-29 10:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-15  8:40 [Bug fortran/101917] New: Spurious -Wstringop-overread with -flto when passing zero sized arrays rimvydas.jas at gmail dot com
2021-11-10  4:48 ` [Bug middle-end/101917] [11 Regression] " msebor at gcc dot gnu.org
2021-11-16 13:08 ` rguenth at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2023-05-29 10:05 ` 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).