public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/47386] New: Wrong warning: ‘w.dim[2].stride’ may be used uninitialized in this function [-Wuninitialized]
@ 2011-01-20 22:02 anlauf at gmx dot de
  2011-01-20 22:03 ` [Bug middle-end/47386] " pinskia at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: anlauf at gmx dot de @ 2011-01-20 22:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47386

           Summary: Wrong warning: ‘w.dim[2].stride’ may be used
                    uninitialized in this function [-Wuninitialized]
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: anlauf@gmx.de


Hi.

the following testcase demonstrates warnings that can be irritating:

% cat gfcbug112.f90
module gfcbug112
  implicit none
  logical             :: ll = .false.
contains
  subroutine calc_W (N, M)
    integer, intent(in) :: N, M

    real                :: T(N,M,M) ! Temporary array 1
    real, allocatable   :: W(:,:,:) ! Temporary array 2

    if(ll) then
       allocate (W(N,M,M))
    end if

    T=0

    if(ll) then
       W = 0
       deallocate (W)
    end if

  end subroutine calc_W
end module gfcbug112
% gfc-trunk -c -Wall -O gfcbug112.f90
gfcbug112.f90: In function ‘calc_w’:
gfcbug112.f90:5:0: warning: ‘w.dim[2].stride’ may be used uninitialized in this
function [-Wuninitialized]


One can get really many of these in large modules...

Harald


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

end of thread, other threads:[~2022-08-29 13:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-20 22:02 [Bug fortran/47386] New: Wrong warning: ‘w.dim[2].stride’ may be used uninitialized in this function [-Wuninitialized] anlauf at gmx dot de
2011-01-20 22:03 ` [Bug middle-end/47386] " pinskia at gcc dot gnu.org
2011-01-21 11:50 ` rguenth at gcc dot gnu.org
2021-04-15  0:46 ` msebor at gcc dot gnu.org
2022-08-29 13:44 ` [Bug tree-optimization/47386] " rguenth 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).