public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "burnus at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/31688] New: Bogus "may be used uninitialized" warning Date: Tue, 24 Apr 2007 18:56:00 -0000 [thread overview] Message-ID: <bug-31688-13404@http.gcc.gnu.org/bugzilla/> (raw) [Based on PR 31683] Compiling the following program with "gfortran -O -Wall" gives the bogus warning: foo2.f90:4: warning: 'offset.7' may be used uninitialized in this function foo2.f90:4: warning: 'stride.6' may be used uninitialized in this function foo2.f90:4: warning: 'pab.0' may be used uninitialized in this function However, this part of code is not reachable if uninitialized. The code is essentially: int offset.7; if(pab != 0B) offset.7 = -stride.6; if (pab == 0B) return; *force_a = (*pab.0)[offset.7] Full Fortran source: MODULE test IMPLICIT NONE CONTAINS SUBROUTINE overlap(s, lds, pab, force_a) INTEGER, INTENT(IN) :: lds REAL, DIMENSION(lds, lds, *), INTENT(INOUT) :: s REAL, DIMENSION(:), INTENT(IN), OPTIONAL :: pab REAL, INTENT(OUT) :: force_a if(.not.present(pab)) return force_a = pab(1)*s(1,1,1) END SUBROUTINE END MODULE test -- Summary: Bogus "may be used uninitialized" warning Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31688
next reply other threads:[~2007-04-24 18:56 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-04-24 18:56 burnus at gcc dot gnu dot org [this message] 2007-04-24 19:06 ` [Bug middle-end/31688] " pinskia at gcc dot gnu dot org 2007-06-20 15:20 ` jv244 at cam dot ac dot uk 2007-06-20 15:26 ` jv244 at cam dot ac dot uk 2007-06-20 16:25 ` [Bug fortran/31688] " burnus at gcc dot gnu dot org 2007-07-03 10:36 ` fxcoudert at gcc dot gnu dot org 2007-07-03 10:37 ` fxcoudert at gcc dot gnu dot org 2007-07-04 7:44 ` fxcoudert at gcc dot gnu dot 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-31688-13404@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).