From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 719A3385841A; Fri, 23 Feb 2024 20:16:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 719A3385841A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708719366; bh=DCahnNVQ5CbsGnnkoDlLifPKovYvvGZmqcpFj+mpMZ4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=LQXvtSMM6qf5/O8a597V7zkBResp6Ej5ibGSAR/bJw/2/rK6Gtpc6X1oVqEj2hMFS gQk3mAa6HTY7bvE3BpIuG+t1E1aie19cNdim9TQm2QP+otZ90Gi4X/DIesBYZAID7M l9bJVXbNrQPkxbLbWDMuPXSaLo1A6cjYtAaW+Vfg= From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/77504] [11/12/13/14 Regression] "is used uninitialized" with allocatable string and array constructors Date: Fri, 23 Feb 2024 20:16:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: unknown X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc dependson Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D77504 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: >=20 > 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 PURPOS= E. >=20 > wws@w6ws-4:~/computer/fortran/tests$ cat a.f90 > program catenate_test > implicit none >=20 > integer, allocatable :: a(:) >=20 > a =3D (/ 1, 3, 5 /) >=20 > print *, 'size(a) =3D', size (a) > print *, 'a =3D', a >=20 > 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: >=20 > 6 | a =3D (/ 1, 3, 5 /) > | ^ > Warning: =E2=80=98a.offset=E2=80=99 is used uninitialized [-Wuninitialize= d] > a.f90:4:30: >=20 > 4 | integer, allocatable :: a(:) > | ^ > note: =E2=80=98a=E2=80=99 declared here > a.f90:6:19: >=20 > 6 | a =3D (/ 1, 3, 5 /) > | ^ > Warning: =E2=80=98a.dim[0].lbound=E2=80=99 is used uninitialized [-Wunini= tialized] > a.f90:4:30: >=20 > 4 | integer, allocatable :: a(:) > | ^ > note: =E2=80=98a=E2=80=99 declared here > a.f90:6:19: >=20 > 6 | a =3D (/ 1, 3, 5 /) > | ^ > Warning: =E2=80=98a.dim[0].ubound=E2=80=99 is used uninitialized [-Wunini= tialized] > a.f90:4:30: >=20 > 4 | integer, allocatable :: a(:) > | ^ > note: =E2=80=98a=E2=80=99 declared here > a.f90:6:19: >=20 > 6 | a =3D (/ 1, 3, 5 /) > | ^ > Warning: =E2=80=98a.dim[0].lbound=E2=80=99 may be used uninitialized [-Wm= aybe-uninitialized] > a.f90:4:30: >=20 > 4 | integer, allocatable :: a(:) > | ^ > note: =E2=80=98a=E2=80=99 declared here > a.f90:6:19: >=20 > 6 | a =3D (/ 1, 3, 5 /) > | ^ > Warning: =E2=80=98a.dim[0].ubound=E2=80=99 may be used uninitialized [-Wm= aybe-uninitialized] > a.f90:4:30: >=20 > 4 | integer, allocatable :: a(:) > | ^ > note: =E2=80=98a=E2=80=99 declared here > wws@w6ws-4:~/computer/fortran/tests$ ./a > size(a) =3D 3 > a =3D 1 3 5 > wws@w6ws-4:~/computer/fortran/tests$ See ttps://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106089 Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106089 [Bug 106089] false positives with -Wuninitialized for allocation on assignm= ent=