public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "dev-zero at gentoo dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/77504] [8/9/10/11 Regression] "is used uninitialized" with allocatable string and array constructors Date: Fri, 24 Jul 2020 14:45:14 +0000 [thread overview] Message-ID: <bug-77504-4-c23LkZaU9u@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-77504-4@http.gcc.gnu.org/bugzilla/> 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`.
next parent reply other threads:[~2020-07-24 14:45 UTC|newest] Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-77504-4@http.gcc.gnu.org/bugzilla/> 2020-07-24 14:45 ` dev-zero at gentoo dot org [this message] 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
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-77504-4-c23LkZaU9u@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).