From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17542 invoked by alias); 15 Dec 2012 13:06:53 -0000 Received: (qmail 17411 invoked by uid 48); 15 Dec 2012 13:06:37 -0000 From: "janus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/55072] [4.6/4.7/4.8 Regression] Missing internal_pack leads to wrong code with derived type Date: Sat, 15 Dec 2012 13:06: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: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: janus at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P4 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.6.4 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: 2012-12/txt/msg01555.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55072 --- Comment #10 from janus at gcc dot gnu.org 2012-12-15 13:06:37 UTC --- Here is a reduced version of internal_pack_10.f90, which is the only runtime-failure in the testsuite for the patch in comment #9: module mo_obs_rules type t_set integer :: use = 0 end type type t_rules character(len=10) :: comment type(t_set) :: c (1) end type contains subroutine set_set_v (src) type(t_set), intent(in) :: src(1) if (any (src%use .ne. 99)) call abort end subroutine end module program test use mo_obs_rules type (t_rules) :: ru (1) ru(1)%c(:)%use = 99 call set_set_v (ru(1)%c) end program The problem is that, without the patch, an array descriptor is generated for the argument to 'set_set_v': parm.3.data = (void *) &ru[0].c[0]; parm.3.offset = -1; set_set_v ((struct t_set[0:] *) parm.3.data); which is not the case with the patch: set_set_v (&ru);