public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/108621] New: [12 regression]: bind(c) pointer array spurious maybe-uninitialized warning
@ 2023-02-01  5:09 michael at scivision dot dev
  2023-02-01  8:10 ` [Bug fortran/108621] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: michael at scivision dot dev @ 2023-02-01  5:09 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108621
           Summary: [12 regression]: bind(c) pointer array spurious
                    maybe-uninitialized warning
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: michael at scivision dot dev
  Target Milestone: ---

GCC 12 introduced a new regression--spurious Wmaybe-initialized warnings from
example code compiled with:

gfortran -Wall -c main.f90

```
program demo
use, intrinsic :: iso_c_binding, only : c_int
implicit none

interface
subroutine fun(f_p) bind(c)
import c_int
integer(c_int), pointer, intent(out) :: f_p(:)
end subroutine
end interface

integer(c_int), pointer :: f(:)

nullify(f)
call fun(f)

end program
```

emits spurious warnings not seen in GCC < 12:

```
   18 | call fcpoint(f)
      |                 ^
Warning: 'f.dim[idx.1_32].lbound' may be used uninitialized
[-Wmaybe-uninitialized]

   14 | integer(c_int), pointer :: f(:)
      |                                 ^
note: 'f' declared here

   18 | call fcpoint(f)
      |                 ^
Warning: 'f.dim[idx.1_32].ubound' may be used uninitialized
[-Wmaybe-uninitialized]

   14 | integer(c_int), pointer :: f(:)
      |                                 ^
note: 'f' declared here

   18 | call fcpoint(f)
      |                 ^
Warning: 'f.dim[idx.1_32].lbound' may be used uninitialized
[-Wmaybe-uninitialized]

   14 | integer(c_int), pointer :: f(:)
      |                                 ^
note: 'f' declared here

   18 | call fcpoint(f)
      |                 ^
Warning: 'f.dim[idx.1_32].stride' may be used uninitialized
[-Wmaybe-uninitialized]

   14 | integer(c_int), pointer :: f(:)
      |                                 ^
note: 'f' declared her
```

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

end of thread, other threads:[~2023-02-27 10:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-01  5:09 [Bug fortran/108621] New: [12 regression]: bind(c) pointer array spurious maybe-uninitialized warning michael at scivision dot dev
2023-02-01  8:10 ` [Bug fortran/108621] " rguenth at gcc dot gnu.org
2023-02-01 18:13 ` kargl at gcc dot gnu.org
2023-02-01 18:17 ` sgk at troutmask dot apl.washington.edu
2023-02-02  2:35 ` jvdelisle at gcc dot gnu.org
2023-02-02  7:39 ` burnus at gcc dot gnu.org
2023-02-23 17:37 ` [Bug fortran/108621] [12/13 " burnus at gcc dot gnu.org
2023-02-25 10:56 ` cvs-commit at gcc dot gnu.org
2023-02-27 10:31 ` burnus 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).