From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23187 invoked by alias); 24 Feb 2012 14:06:18 -0000 Received: (qmail 23177 invoked by uid 22791); 24 Feb 2012 14:06:18 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Feb 2012 14:06:05 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/52370] Spurious "may be used uninitialized" warning for check of optional argument Date: Fri, 24 Feb 2012 14:17:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: minor X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Keywords Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-02/txt/msg02412.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52370 Tobias Burnus changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic --- Comment #2 from Tobias Burnus 2012-02-24 14:05:32 UTC --- (In reply to comment #1) > The warning is not printed for the last line where one dereferences a pointer > (line 8), but for the "b.0 =" assignment. I have the impression that problem is rather line 8 - i.e. related to the pointer dereference. The warning vanishes if one comments/moves the "a =" line - unless "b" is volatile - or if one makes "a" a VALUE or a function result. I assume that's because it is then simpler to merge the implicitly and the explicitly created "if (present(b))" lines.