public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result
@ 2013-09-13  8:47 vladimir.fuka at gmail dot com
  2013-09-15 22:02 ` [Bug fortran/58410] [4.8/4.9 Regression] " janus at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vladimir.fuka at gmail dot com @ 2013-09-13  8:47 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 3206 bytes --]

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410

            Bug ID: 58410
           Summary: Bogus uninitialized variable warning for allocatable
                    derived type array function result
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vladimir.fuka at gmail dot com

gfortran  -c -Wall -O2 uninit.f90 
uninit.f90: In function ‘sub’:
uninit.f90:22:0: warning: ‘new.dim[0].ubound’ may be used uninitialized in this
function [-Wmaybe-uninitialized]
         new = fun()
 ^


gfortran  -c -Wall -O1 uninit.f90
without warning




gfortran  -v
Using built-in specs.
COLLECT_GCC=gfortran
COLLECT_LTO_WRAPPER=/usr/local/gcc-4.8/lib/gcc/x86_64-unknown-linux-gnu/4.8.1/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.8-20130509/configure --enable-languages=c,c++,fortran
--with-cloog --prefix=/usr/local/gcc-4.8
Thread model: posix
gcc version 4.8.1 20130509 (prerelease) (GCC)
>From gcc-bugs-return-429727-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Sep 13 08:48:25 2013
Return-Path: <gcc-bugs-return-429727-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11883 invoked by alias); 13 Sep 2013 08:48:24 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11848 invoked by uid 48); 13 Sep 2013 08:48:21 -0000
From: "vladimir.fuka at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/58410] Bogus uninitialized variable warning for allocatable derived type array function result
Date: Fri, 13 Sep 2013 08:48: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-Version: 4.8.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: vladimir.fuka 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-Flags:
X-Bugzilla-Changed-Fields: attachments.created
Message-ID: <bug-58410-4-88bter3akc@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58410-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58410-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg00967.txt.bz2
Content-length: 229

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX410

--- Comment #1 from Vladimir Fuka <vladimir.fuka at gmail dot com> ---
Created attachment 30815
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0815&actioníit
uninit.f90


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/58410] [4.8/4.9 Regression] Bogus uninitialized variable warning for allocatable derived type array function result
  2013-09-13  8:47 [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result vladimir.fuka at gmail dot com
@ 2013-09-15 22:02 ` janus at gcc dot gnu.org
  2013-11-18 19:28 ` janus at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: janus at gcc dot gnu.org @ 2013-09-15 22:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410

janus at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-09-15
                 CC|                            |janus at gcc dot gnu.org
            Summary|Bogus uninitialized         |[4.8/4.9 Regression] Bogus
                   |variable warning for        |uninitialized variable
                   |allocatable derived type    |warning for allocatable
                   |array function result       |derived type array function
                   |                            |result
     Ever confirmed|0                           |1

--- Comment #2 from janus at gcc dot gnu.org ---
Confirmed with 4.8 and trunk. The bogus warning does not seem to appear with
4.7.3.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/58410] [4.8/4.9 Regression] Bogus uninitialized variable warning for allocatable derived type array function result
  2013-09-13  8:47 [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result vladimir.fuka at gmail dot com
  2013-09-15 22:02 ` [Bug fortran/58410] [4.8/4.9 Regression] " janus at gcc dot gnu.org
@ 2013-11-18 19:28 ` janus at gcc dot gnu.org
  2013-11-19  9:51 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: janus at gcc dot gnu.org @ 2013-11-18 19:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410

--- Comment #3 from janus at gcc dot gnu.org ---
Slightly reduced test case:


module m
  implicit none

  type series
    real,allocatable :: a(:)
  end type

  contains

    function fun()
      type(series),allocatable :: fun(:)
      allocate(fun(0))
    end function

    subroutine sub
      type(series),allocatable :: new(:)
      integer :: j
      do j=1,2
        new = fun()
      end do
    end subroutine

end module


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/58410] [4.8/4.9 Regression] Bogus uninitialized variable warning for allocatable derived type array function result
  2013-09-13  8:47 [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result vladimir.fuka at gmail dot com
  2013-09-15 22:02 ` [Bug fortran/58410] [4.8/4.9 Regression] " janus at gcc dot gnu.org
  2013-11-18 19:28 ` janus at gcc dot gnu.org
@ 2013-11-19  9:51 ` rguenth at gcc dot gnu.org
  2013-11-21 14:30 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-19  9:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.8.3


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/58410] [4.8/4.9 Regression] Bogus uninitialized variable warning for allocatable derived type array function result
  2013-09-13  8:47 [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result vladimir.fuka at gmail dot com
                   ` (2 preceding siblings ...)
  2013-11-19  9:51 ` rguenth at gcc dot gnu.org
@ 2013-11-21 14:30 ` rguenth at gcc dot gnu.org
  2013-11-30 18:47 ` pault at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-21 14:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
           Priority|P3                          |P2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/58410] [4.8/4.9 Regression] Bogus uninitialized variable warning for allocatable derived type array function result
  2013-09-13  8:47 [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result vladimir.fuka at gmail dot com
                   ` (3 preceding siblings ...)
  2013-11-21 14:30 ` rguenth at gcc dot gnu.org
@ 2013-11-30 18:47 ` pault at gcc dot gnu.org
  2013-12-19 15:32 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2013-11-30 18:47 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3
                 CC|                            |pault at gcc dot gnu.org
           Assignee|unassigned at gcc dot gnu.org      |pault at gcc dot gnu.org

--- Comment #4 from Paul Thomas <pault at gcc dot gnu.org> ---
This is not a serious regression and so I have set it to P3.

That said, it is a real bug and I am just now regtesting the fix.

Assigning myself.

Paul


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/58410] [4.8/4.9 Regression] Bogus uninitialized variable warning for allocatable derived type array function result
  2013-09-13  8:47 [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result vladimir.fuka at gmail dot com
                   ` (4 preceding siblings ...)
  2013-11-30 18:47 ` pault at gcc dot gnu.org
@ 2013-12-19 15:32 ` rguenth at gcc dot gnu.org
  2014-01-19 18:04 ` pault at gcc dot gnu.org
  2014-01-19 18:07 ` pault at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-12-19 15:32 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/58410] [4.8/4.9 Regression] Bogus uninitialized variable warning for allocatable derived type array function result
  2013-09-13  8:47 [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result vladimir.fuka at gmail dot com
                   ` (5 preceding siblings ...)
  2013-12-19 15:32 ` rguenth at gcc dot gnu.org
@ 2014-01-19 18:04 ` pault at gcc dot gnu.org
  2014-01-19 18:07 ` pault at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2014-01-19 18:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410

--- Comment #6 from Paul Thomas <pault at gcc dot gnu.org> ---
Author: pault
Date: Sun Jan 19 18:04:22 2014
New Revision: 206778

URL: http://gcc.gnu.org/viewcvs?rev=206778&root=gcc&view=rev
Log:
2014-01-19  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/58410
    * trans-array.c (gfc_alloc_allocatable_for_assignment): Do not
    use the array bounds of an unallocated array but set its size
    to zero instead.

Modified:
    branches/gcc-4_8-branch/gcc/fortran/ChangeLog
    branches/gcc-4_8-branch/gcc/fortran/trans-array.c


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug fortran/58410] [4.8/4.9 Regression] Bogus uninitialized variable warning for allocatable derived type array function result
  2013-09-13  8:47 [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result vladimir.fuka at gmail dot com
                   ` (6 preceding siblings ...)
  2014-01-19 18:04 ` pault at gcc dot gnu.org
@ 2014-01-19 18:07 ` pault at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pault at gcc dot gnu.org @ 2014-01-19 18:07 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58410

Paul Thomas <pault at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #7 from Paul Thomas <pault at gcc dot gnu.org> ---
Fixed on trunk and 4.8.

Thanks for the report

Paul


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-01-19 18:07 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-13  8:47 [Bug fortran/58410] New: Bogus uninitialized variable warning for allocatable derived type array function result vladimir.fuka at gmail dot com
2013-09-15 22:02 ` [Bug fortran/58410] [4.8/4.9 Regression] " janus at gcc dot gnu.org
2013-11-18 19:28 ` janus at gcc dot gnu.org
2013-11-19  9:51 ` rguenth at gcc dot gnu.org
2013-11-21 14:30 ` rguenth at gcc dot gnu.org
2013-11-30 18:47 ` pault at gcc dot gnu.org
2013-12-19 15:32 ` rguenth at gcc dot gnu.org
2014-01-19 18:04 ` pault at gcc dot gnu.org
2014-01-19 18:07 ` pault at gcc dot gnu.org

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).