public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
@ 2020-07-24 14:45 ` dev-zero at gentoo dot org
  2020-07-24 15:57 ` kargl at gcc dot gnu.org
                   ` (12 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: dev-zero at gentoo dot org @ 2020-07-24 14:45 UTC (permalink / raw)
  To: gcc-bugs

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

Tiziano Müller <dev-zero at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dev-zero at gentoo dot org

--- Comment #19 from Tiziano Müller <dev-zero at gentoo dot org> ---
I have yet another (more complicated) case, but this time not reproducible with
gcc-7.5, only with 9 and 10:

** snip: moda.f90 ***
module moda
contains
   PURE SUBROUTINE funca(arr, sz)
      REAL, ALLOCATABLE, DIMENSION(:, :), INTENT(OUT) :: arr
      integer, intent(in) :: sz
      allocate(arr(sz, sz))
      arr(:, :) = 0.
   END SUBROUTINE
end module
*** end snip ***

*** snip: modb.f90 ***
module modb
    use moda, only: funca
contains
   PURE SUBROUTINE funcb(oarr)
      REAL, DIMENSION(:), INTENT(OUT)    :: oarr
      REAL, ALLOCATABLE, DIMENSION(:, :) :: arr

      oarr(:) = 0.0

      CALL funca(arr, ubound(oarr, 1))
      oarr = MATMUL(TRANSPOSE(arr), oarr)*1.
   END SUBROUTINE funcb
end module
*** end snip ***

building with:

gfortran -O1 -Werror=uninitialized -c moda.f90
gfortran -O1 -Werror=uninitialized -c modb.f90

triggers:

*** snip: output ***
modb.f90:11:0:

   11 |       oarr = MATMUL(TRANSPOSE(arr), oarr)*1.
      | 
Error: ‘__var_1_matmul.dim[0].lbound’ is used uninitialized in this function
[-Werror=uninitialized]
modb.f90:11:0: Error: ‘__var_1_matmul.dim[0].ubound’ is used uninitialized in
this function [-Werror=uninitialized]
f951: some warnings being treated as errors
*** end snip ***

Removing either the `*1` at the end or the call to `transpose` makes the
warning/error go away. As does using `-O0`.

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

* [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
  2020-07-24 14:45 ` [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors dev-zero at gentoo dot org
@ 2020-07-24 15:57 ` kargl at gcc dot gnu.org
  2020-07-24 16:47 ` tkoenig at gcc dot gnu.org
                   ` (11 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-07-24 15:57 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org

--- Comment #20 from kargl at gcc dot gnu.org ---
(In reply to Tiziano Müller from comment #19)

> 
> *** snip: modb.f90 ***
> module modb
>     use moda, only: funca
> contains
>    PURE SUBROUTINE funcb(oarr)
>       REAL, DIMENSION(:), INTENT(OUT)    :: oarr

intent(out) causes oarr to be deallocated on entry
into funcb().

>       REAL, ALLOCATABLE, DIMENSION(:, :) :: arr
> 
>       oarr(:) = 0.0

oarr(:) is an array section of an unallocated array.
This is invalid Fortran.  So gfortran can do whatever
she wants with the code.

>       CALL funca(arr, ubound(oarr, 1))
>       oarr = MATMUL(TRANSPOSE(arr), oarr)*1.
>    END SUBROUTINE funcb
> end module
> *** end snip ***

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

* [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
  2020-07-24 14:45 ` [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors dev-zero at gentoo dot org
  2020-07-24 15:57 ` kargl at gcc dot gnu.org
@ 2020-07-24 16:47 ` tkoenig at gcc dot gnu.org
  2020-07-24 17:20 ` kargl at gcc dot gnu.org
                   ` (10 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2020-07-24 16:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from Thomas Koenig <tkoenig at gcc dot gnu.org> ---

(In reply to Tiziano Müller from comment #19)
> I have yet another (more complicated) case, but this time not reproducible
> with gcc-7.5, only with 9 and 10:

This is a different issue. I have opened PR 96312 for this.

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

* [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-07-24 16:47 ` tkoenig at gcc dot gnu.org
@ 2020-07-24 17:20 ` kargl at gcc dot gnu.org
  2020-07-27 12:43 ` dev-zero at gentoo dot org
                   ` (9 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: kargl at gcc dot gnu.org @ 2020-07-24 17:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from kargl at gcc dot gnu.org ---
(In reply to kargl from comment #20)
> (In reply to Tiziano Müller from comment #19)
> 
> > 
> > *** snip: modb.f90 ***
> > module modb
> >     use moda, only: funca
> > contains
> >    PURE SUBROUTINE funcb(oarr)
> >       REAL, DIMENSION(:), INTENT(OUT)    :: oarr
> 
> intent(out) causes oarr to be deallocated on entry
> into funcb().
> 
> >       REAL, ALLOCATABLE, DIMENSION(:, :) :: arr
> > 
> >       oarr(:) = 0.0
> 
> oarr(:) is an array section of an unallocated array.
> This is invalid Fortran.  So gfortran can do whatever
> she wants with the code.

Dang, nevermind!
Misread code.

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

* [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2020-07-24 17:20 ` kargl at gcc dot gnu.org
@ 2020-07-27 12:43 ` dev-zero at gentoo dot org
  2021-03-31 22:50 ` msebor at gcc dot gnu.org
                   ` (8 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: dev-zero at gentoo dot org @ 2020-07-27 12:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from Tiziano Müller <dev-zero at gentoo dot org> ---
(In reply to Thomas Koenig from comment #21)
> (In reply to Tiziano Müller from comment #19)
> > I have yet another (more complicated) case, but this time not reproducible
> > with gcc-7.5, only with 9 and 10:
> 
> This is a different issue. I have opened PR 96312 for this.

Thanks a lot! I prepared a new bug report initially, then I stumbled over this
one and thought it could be the same.

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

* [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2020-07-27 12:43 ` dev-zero at gentoo dot org
@ 2021-03-31 22:50 ` msebor at gcc dot gnu.org
  2021-05-14  9:48 ` [Bug fortran/77504] [9/10/11/12 " jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: msebor at gcc dot gnu.org @ 2021-03-31 22:50 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org
             Blocks|24639                       |

--- Comment #24 from Martin Sebor <msebor at gcc dot gnu.org> ---
Since this is a true positive removing the -Wuninitilized dependency based on
comment #14.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=24639
[Bug 24639] [meta-bug] bug to track all Wuninitialized issues

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

* [Bug fortran/77504] [9/10/11/12 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-03-31 22:50 ` msebor at gcc dot gnu.org
@ 2021-05-14  9:48 ` jakub at gcc dot gnu.org
  2021-06-01  8:08 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|8.5                         |9.4

--- Comment #25 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

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

* [Bug fortran/77504] [9/10/11/12 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2021-05-14  9:48 ` [Bug fortran/77504] [9/10/11/12 " jakub at gcc dot gnu.org
@ 2021-06-01  8:08 ` rguenth at gcc dot gnu.org
  2022-01-17 14:24 ` mailling-lists-bd at posteo dot de
                   ` (5 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:08 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #26 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug fortran/77504] [9/10/11/12 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2021-06-01  8:08 ` rguenth at gcc dot gnu.org
@ 2022-01-17 14:24 ` mailling-lists-bd at posteo dot de
  2022-05-27  9:36 ` [Bug fortran/77504] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: mailling-lists-bd at posteo dot de @ 2022-01-17 14:24 UTC (permalink / raw)
  To: gcc-bugs

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

Baptiste Demoulin <mailling-lists-bd at posteo dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mailling-lists-bd at posteo dot de

--- Comment #27 from Baptiste Demoulin <mailling-lists-bd at posteo dot de> ---
I don't know if it is related to this bug, but I found that this program:

program test_allocatable
  implicit none

  integer, allocatable  :: array(:)
  character(len=:), allocatable :: string

  integer :: i
  character(len=64) :: buf

  allocate(array(4))
  array = [1, 2, 3, 4]

  do i=1, size(array) - 1
     write(buf, '(I0)') array(i)
     string = string//trim(buf)//','
  end do

  write(buf, '(I0)') array(size(array))
  string = string//trim(buf)

  write(*, '(A)') string

end program test_allocatable

yields:

gfortran -Wuninitialized allocatable_string.f90
allocatable_string.f90:20:28:

   20 |   string = string//trim(buf)
      |                            ^
Warning: ‘.__var_2_realloc_string’ may be used uninitialized
[-Wmaybe-uninitialized]

If the line "string = string//trim(buf)" after the loop is commented, then the
warning disppears.

The test was run on Fedora, where "gfortran --version" yields:

GNU Fortran (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7)
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

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

* [Bug fortran/77504] [10/11/12/13 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2022-01-17 14:24 ` mailling-lists-bd at posteo dot de
@ 2022-05-27  9:36 ` rguenth at gcc dot gnu.org
  2022-06-28 10:32 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:36 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #28 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug fortran/77504] [10/11/12/13 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2022-05-27  9:36 ` [Bug fortran/77504] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:32 ` jakub at gcc dot gnu.org
  2023-07-07 10:31 ` [Bug fortran/77504] [11/12/13/14 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  13 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:32 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #29 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug fortran/77504] [11/12/13/14 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2022-06-28 10:32 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:31 ` rguenth at gcc dot gnu.org
  2024-02-23 19:15 ` w6ws at earthlink dot net
  2024-02-23 20:16 ` kargl at gcc dot gnu.org
  13 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:31 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #30 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

* [Bug fortran/77504] [11/12/13/14 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (11 preceding siblings ...)
  2023-07-07 10:31 ` [Bug fortran/77504] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2024-02-23 19:15 ` w6ws at earthlink dot net
  2024-02-23 20:16 ` kargl at gcc dot gnu.org
  13 siblings, 0 replies; 14+ messages in thread
From: w6ws at earthlink dot net @ 2024-02-23 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

Walter Spector <w6ws at earthlink dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |w6ws at earthlink dot net

--- Comment #31 from Walter Spector <w6ws at earthlink dot net> ---
Super simple test case:

wws@w6ws-4:~/computer/fortran/tests$ /usr/local/bin/gfortran --version
GNU Fortran (GCC) 14.0.1 20240115 (experimental)
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

wws@w6ws-4:~/computer/fortran/tests$ cat a.f90
program catenate_test
  implicit none

  integer, allocatable :: a(:)

  a = (/ 1, 3, 5 /)

  print *, 'size(a) =', size (a)
  print *, 'a =', a

end program
wws@w6ws-4:~/computer/fortran/tests$ /usr/local/bin/gfortran -o a a.f90
wws@w6ws-4:~/computer/fortran/tests$ /usr/local/bin/gfortran -Wall -o a a.f90
a.f90:6:19:

    6 |   a = (/ 1, 3, 5 /)
      |                   ^
Warning: ‘a.offset’ is used uninitialized [-Wuninitialized]
a.f90:4:30:

    4 |   integer, allocatable :: a(:)
      |                              ^
note: ‘a’ declared here
a.f90:6:19:

    6 |   a = (/ 1, 3, 5 /)
      |                   ^
Warning: ‘a.dim[0].lbound’ is used uninitialized [-Wuninitialized]
a.f90:4:30:

    4 |   integer, allocatable :: a(:)
      |                              ^
note: ‘a’ declared here
a.f90:6:19:

    6 |   a = (/ 1, 3, 5 /)
      |                   ^
Warning: ‘a.dim[0].ubound’ is used uninitialized [-Wuninitialized]
a.f90:4:30:

    4 |   integer, allocatable :: a(:)
      |                              ^
note: ‘a’ declared here
a.f90:6:19:

    6 |   a = (/ 1, 3, 5 /)
      |                   ^
Warning: ‘a.dim[0].lbound’ may be used uninitialized [-Wmaybe-uninitialized]
a.f90:4:30:

    4 |   integer, allocatable :: a(:)
      |                              ^
note: ‘a’ declared here
a.f90:6:19:

    6 |   a = (/ 1, 3, 5 /)
      |                   ^
Warning: ‘a.dim[0].ubound’ may be used uninitialized [-Wmaybe-uninitialized]
a.f90:4:30:

    4 |   integer, allocatable :: a(:)
      |                              ^
note: ‘a’ declared here
wws@w6ws-4:~/computer/fortran/tests$ ./a
 size(a) =           3
 a =           1           3           5
wws@w6ws-4:~/computer/fortran/tests$

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

* [Bug fortran/77504] [11/12/13/14 Regression] "is used uninitialized" with allocatable string and array constructors
       [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
                   ` (12 preceding siblings ...)
  2024-02-23 19:15 ` w6ws at earthlink dot net
@ 2024-02-23 20:16 ` kargl at gcc dot gnu.org
  13 siblings, 0 replies; 14+ messages in thread
From: kargl at gcc dot gnu.org @ 2024-02-23 20:16 UTC (permalink / raw)
  To: gcc-bugs

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

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu.org
         Depends on|                            |106089

--- Comment #32 from kargl at gcc dot gnu.org ---
(In reply to Walter Spector from comment #31)
> Super simple test case:
> 
> wws@w6ws-4:~/computer/fortran/tests$ /usr/local/bin/gfortran --version
> GNU Fortran (GCC) 14.0.1 20240115 (experimental)
> Copyright (C) 2024 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> wws@w6ws-4:~/computer/fortran/tests$ cat a.f90
> program catenate_test
>   implicit none
> 
>   integer, allocatable :: a(:)
> 
>   a = (/ 1, 3, 5 /)
> 
>   print *, 'size(a) =', size (a)
>   print *, 'a =', a
> 
> end program
> wws@w6ws-4:~/computer/fortran/tests$ /usr/local/bin/gfortran -o a a.f90
> wws@w6ws-4:~/computer/fortran/tests$ /usr/local/bin/gfortran -Wall -o a a.f90
> a.f90:6:19:
> 
>     6 |   a = (/ 1, 3, 5 /)
>       |                   ^
> Warning: ‘a.offset’ is used uninitialized [-Wuninitialized]
> a.f90:4:30:
> 
>     4 |   integer, allocatable :: a(:)
>       |                              ^
> note: ‘a’ declared here
> a.f90:6:19:
> 
>     6 |   a = (/ 1, 3, 5 /)
>       |                   ^
> Warning: ‘a.dim[0].lbound’ is used uninitialized [-Wuninitialized]
> a.f90:4:30:
> 
>     4 |   integer, allocatable :: a(:)
>       |                              ^
> note: ‘a’ declared here
> a.f90:6:19:
> 
>     6 |   a = (/ 1, 3, 5 /)
>       |                   ^
> Warning: ‘a.dim[0].ubound’ is used uninitialized [-Wuninitialized]
> a.f90:4:30:
> 
>     4 |   integer, allocatable :: a(:)
>       |                              ^
> note: ‘a’ declared here
> a.f90:6:19:
> 
>     6 |   a = (/ 1, 3, 5 /)
>       |                   ^
> Warning: ‘a.dim[0].lbound’ may be used uninitialized [-Wmaybe-uninitialized]
> a.f90:4:30:
> 
>     4 |   integer, allocatable :: a(:)
>       |                              ^
> note: ‘a’ declared here
> a.f90:6:19:
> 
>     6 |   a = (/ 1, 3, 5 /)
>       |                   ^
> Warning: ‘a.dim[0].ubound’ may be used uninitialized [-Wmaybe-uninitialized]
> a.f90:4:30:
> 
>     4 |   integer, allocatable :: a(:)
>       |                              ^
> note: ‘a’ declared here
> wws@w6ws-4:~/computer/fortran/tests$ ./a
>  size(a) =           3
>  a =           1           3           5
> wws@w6ws-4:~/computer/fortran/tests$

See ttps://gcc.gnu.org/bugzilla/show_bug.cgi?id=106089


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106089
[Bug 106089] false positives with -Wuninitialized for allocation on assignment

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

end of thread, other threads:[~2024-02-23 20:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/>
2020-07-24 14:45 ` [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors dev-zero at gentoo dot org
2020-07-24 15:57 ` kargl at gcc dot gnu.org
2020-07-24 16:47 ` tkoenig at gcc dot gnu.org
2020-07-24 17:20 ` kargl at gcc dot gnu.org
2020-07-27 12:43 ` dev-zero at gentoo dot org
2021-03-31 22:50 ` msebor at gcc dot gnu.org
2021-05-14  9:48 ` [Bug fortran/77504] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:08 ` rguenth at gcc dot gnu.org
2022-01-17 14:24 ` mailling-lists-bd at posteo dot de
2022-05-27  9:36 ` [Bug fortran/77504] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:32 ` jakub at gcc dot gnu.org
2023-07-07 10:31 ` [Bug fortran/77504] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-02-23 19:15 ` w6ws at earthlink dot net
2024-02-23 20:16 ` kargl 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).