From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28066 invoked by alias); 30 Apr 2013 17:34:52 -0000 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 Received: (qmail 28043 invoked by uid 48); 30 Apr 2013 17:34:48 -0000 From: "AstroFloyd at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/57127] New: gfortran gives unintended warning on uninitialized optional dummy array of undetermined size Date: Tue, 30 Apr 2013 17:34:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: AstroFloyd at gmail dot com 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: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg02448.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D57127 Bug #: 57127 Summary: gfortran gives unintended warning on uninitialized optional dummy array of undetermined size Classification: Unclassified Product: gcc Version: 4.7.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: AstroFloyd@gmail.com Created attachment 29985 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=3D29985 Source file example.f90 used in the example in the bug report gfortran-4.7.2 -O1 -Wall gives unintended warning about uninitialized array elements when a routine is called with an optional dummy array of undetermi= ned size (example.f90 is attached below): $ gfortran -O1 -Wall example.f90 -o example && ./example example.f90: In function =E2=80=98example_routine=E2=80=99: example.f90:8:0: warning: =E2=80=98array.0=E2=80=99 may be used uninitializ= ed in this function [-Wmaybe-uninitialized] Expected behaviour: no warning message. The warning goes away when: * -O0 is used rather than -O1 or higher * -Wall is replaced by -Wmaybe-uninitialized * the line write(op,'(A)') 'foo' is commented out >>From gcc-bugs-return-421304-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Apr 30 17:51:53 2013 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 4180 invoked by alias); 30 Apr 2013 17:51:53 -0000 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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 4152 invoked by uid 48); 30 Apr 2013 17:51:50 -0000 From: "dominiq at lps dot ens.fr" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/57127] gfortran gives unintended warning on uninitialized optional dummy array of undetermined size Date: Tue, 30 Apr 2013 17:51: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: X-Bugzilla-Severity: normal X-Bugzilla-Who: dominiq at lps dot ens.fr X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Status Last reconfirmed Ever Confirmed 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 X-SW-Source: 2013-04/txt/msg02449.txt.bz2 Content-length: 571 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57127 Dominique d'Humieres changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2013-04-30 Ever Confirmed|0 |1 --- Comment #1 from Dominique d'Humieres 2013-04-30 17:51:49 UTC --- The warning is present for 4.6, 4.7, 4.8, and trunk.