From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20352 invoked by alias); 14 Jan 2013 21:30:00 -0000 Received: (qmail 20175 invoked by uid 48); 14 Jan 2013 21:29:26 -0000 From: "tkoenig at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55978] [4.8 Regression] class_optional_2.f90 -Os fails Date: Mon, 14 Jan 2013 21:30: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: tkoenig 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: 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: 2013-01/txt/msg01242.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55978 --- Comment #1 from Thomas Koenig 2013-01-14 21:29:25 UTC --- For -O0, valgrind complains about ==15263== Conditional jump or move depends on uninitialised value(s) ==15263== at 0x4F26355: _gfortran_internal_pack (in_pack_generic.c:54) ==15263== by 0x403762: a3a1.2119 (in /home/ig25/Krempel/Os/a.out) ==15263== by 0x400B26: MAIN__ (in /home/ig25/Krempel/Os/a.out) ==15263== by 0x408F0E: main (in /home/ig25/Krempel/Os/a.out) and ==15263== ==15263== Conditional jump or move depends on uninitialised value(s) ==15263== at 0x4F26447: _gfortran_internal_pack (in_pack_generic.c:159) ==15263== by 0x403762: a3a1.2119 (in /home/ig25/Krempel/Os/a.out) ==15263== by 0x400B26: MAIN__ (in /home/ig25/Krempel/Os/a.out) ==15263== by 0x408F0E: main (in /home/ig25/Krempel/Os/a.out) which is size = GFC_DESCRIPTOR_SIZE (source); switch (type_size) and dim = GFC_DESCRIPTOR_RANK (source); respectively. Reduced test case (run with -fcoarray=single): ! { dg-do run } ! { dg-options "-fcoarray=single" } ! ! PR fortran/50981 ! PR fortran/54618 ! implicit none type t integer, allocatable :: i end type t type, extends (t):: t2 integer, allocatable :: j end type t2 call a3a() contains subroutine a3a(z, z2, z3) type(t2), optional :: z(4) type(t2), optional, pointer :: z2(:) type(t2), optional, allocatable :: z3(:) type(t2), allocatable :: x(:) type(t2), pointer :: y(:) y => null() call a4t2(y) end subroutine a3a subroutine a4t2(x) type(t2), intent(in), optional :: x(4) if (present (x)) call abort () !print *, present(x) end subroutine a4t2 end