From patchwork Mon Mar 12 18:00:43 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 146191 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id E696AB6FAF for ; Tue, 13 Mar 2012 05:01:15 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1332180076; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=7Q+lFVB9IZ0Ug0++VmmQ5DbmEYY=; b=oxgGoO3KDRBYApn LUGvbBgTi68XJ6UdZvbYSZjsYj7UW2qfNo8K7weR7IUP87uRd9i+dvqMVvB0KgFP hGVeHDsreCWKAL1QJ9YWyqJLI2W+w+nMDZgDw7xt6N82EzSZd+l6CCTgh+FRQblv QXRrruzcjmMk9Jcb98/fPXH2OJpA= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=wurFJzrbDvCweHrkZMljwLwFFj/2MPlMVsmNCiRrY4jYYnLhTZw+A3NmI8Zed4 wWcPHCi7UJobtCti9RUdlE50x8sOZUiRaLFgGg573CjIIMKGVDPirVkp6k69oDty 1LebyfARdljrFcr6BrkC0DpZdXIcBCuVxeXaufElXoVLE=; Received: (qmail 21914 invoked by alias); 12 Mar 2012 18:01:05 -0000 Received: (qmail 21875 invoked by uid 22791); 12 Mar 2012 18:01:02 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_BG X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Mar 2012 18:00:46 +0000 Received: from [192.168.178.22] (port-92-204-75-4.dynamic.qsc.de [92.204.75.4]) by mx01.qsc.de (Postfix) with ESMTP id 351DC1978F; Mon, 12 Mar 2012 19:00:44 +0100 (CET) Message-ID: <4F5E39CB.80301@net-b.de> Date: Mon, 12 Mar 2012 19:00:43 +0100 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.2) Gecko/20120215 Thunderbird/10.0.2 MIME-Version: 1.0 To: fortran@gcc.gnu.org CC: gcc patches Subject: Re: [Fortran-dev, patch, committed] Minor fixes References: <4F5DF102.7000100@net-b.de> In-Reply-To: <4F5DF102.7000100@net-b.de> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 03/12/2012 01:50 PM, Tobias Burnus wrote: > Additionally, I modified some tree-dump patterns for the extent and > for the base_addr change. Three more changes: The libgfortran change should have been just a cleanup, but it seems to also fix a failure. Plus two dump changes. The number of failures is now down to 160 FAIL lines - or to the following 18 test cases (plus three which fail also on the trunk): gfortran.dg/c_f_pointer_complex.f03 gfortran.dg/c_f_pointer_shape_tests_2.f03 gfortran.dg/c_f_pointer_shape_tests_4.f03 gfortran.dg/c_f_pointer_tests.f90 gfortran.dg/c_f_pointer_tests_4.f90 gfortran.dg/optional_dim_3.f90 gfortran.dg/associated_2.f90 gfortran.dg/auto_char_dummy_array_1.f90 gfortran.dg/class_array_1.f03 gfortran.dg/auto_char_len_3.f90 gfortran.dg/class_array_1.f03 gfortran.dg/class_array_2.f03 gfortran.dg/class_array_3.f03 gfortran.dg/class_to_type_1.f03 gfortran.dg/proc_decl_23.f90 gfortran.dg/read_eof_all.f90 gfortran.dg/transfer_intrinsic_3.f90 gfortran.dg/subref_array_pointer_2.f90 The array c_f_pointer function fails because the fptr's size is not set (it is needed to set the sm). Solution: Handle everything in the FE. Tobias Index: libgfortran/ChangeLog.fortran-dev =================================================================== --- libgfortran/ChangeLog.fortran-dev (revision 185216) +++ libgfortran/ChangeLog.fortran-dev (working copy) @@ -1,5 +1,9 @@ 2012-03-12 Tobias Burnus + * intrinsics/spread_generic.c (spread_internal): Properly use "sm". + +2012-03-12 Tobias Burnus + * intrinsics/iso_c_binding.c (c_f_pointer_u0): Use GFC_DESCRIPTOR_SM instead of GFC_DESCRIPTOR_STRIDE_BYTES. Index: libgfortran/intrinsics/spread_generic.c =================================================================== --- libgfortran/intrinsics/spread_generic.c (revision 185199) +++ libgfortran/intrinsics/spread_generic.c (working copy) @@ -71,18 +71,18 @@ spread_internal (gfc_array_char *ret, const gfc_ar /* The front end has signalled that we need to populate the return array descriptor. */ - size_t ub, stride; + size_t ext, sm; ret->dtype = (source->dtype & ~GFC_DTYPE_RANK_MASK) | rrank; dim = 0; - rs = 1; + rs = size; for (n = 0; n < rrank; n++) { - stride = rs; + sm = rs; if (n == *along - 1) { - ub = ncopies - 1; - rdelta = rs * size; + ext = ncopies; + rdelta = rs; rs *= ncopies; } else @@ -90,17 +90,17 @@ spread_internal (gfc_array_char *ret, const gfc_ar count[dim] = 0; extent[dim] = GFC_DESCRIPTOR_EXTENT(source,dim); sstride[dim] = GFC_DESCRIPTOR_SM(source,dim); - rstride[dim] = rs * size; + rstride[dim] = rs; - ub = extent[dim]-1; + ext = extent[dim]; rs *= extent[dim]; dim++; } - GFC_DIMENSION_SET (ret->dim[n], 0, ub, stride*size); + GFC_DIMENSION_SET (ret->dim[n], 0, ext, sm); } ret->offset = 0; - ret->base_addr = internal_malloc_size (rs * size); + ret->base_addr = internal_malloc_size (rs); if (rs <= 0) return; Index: gcc/testsuite/gfortran.dg/internal_pack_4.f90 =================================================================== --- gcc/testsuite/gfortran.dg/internal_pack_4.f90 (revision 185197) +++ gcc/testsuite/gfortran.dg/internal_pack_4.f90 (working copy) @@ -26,7 +26,7 @@ USE M1 CALL S2() END -! { dg-final { scan-tree-dump-times "a != 0B \\? \\\(.*\\\) _gfortran_internal_pack" 1 "original" } } -! { dg-final { scan-tree-dump-times "if \\(a != 0B &&" 1 "original" } } +! { dg-final { scan-tree-dump-times " a != 0B && \\(real\\(kind=.\\).0:. . restrict\\) a->base_addr != 0B \\? \\\(.*\\\) _gfortran_internal_pack" 1 "original" } } +! { dg-final { scan-tree-dump-times "if \\(\\(a != 0B && \\(real\\(kind=.\\).0:. . restrict\\) a->base_addr != 0B\\) &&" 1 "original" } } ! { dg-final { cleanup-tree-dump "original" } } ! { dg-final { cleanup-modules "m1" } } Index: gcc/testsuite/gfortran.dg/assign_10.f90 =================================================================== --- gcc/testsuite/gfortran.dg/assign_10.f90 (revision 185197) +++ gcc/testsuite/gfortran.dg/assign_10.f90 (working copy) @@ -23,6 +23,6 @@ end ! cases will all yield a temporary, so that atmp appears 18 times. ! Note that it is the kind conversion that generates the temp. ! -! { dg-final { scan-tree-dump-times "parm" 18 "original" } } -! { dg-final { scan-tree-dump-times "atmp" 18 "original" } } +! { dg-final { scan-tree-dump-times "parm" 20 "original" } } +! { dg-final { scan-tree-dump-times "atmp" 20 "original" } } ! { dg-final { cleanup-tree-dump "original" } } Index: gcc/testsuite/ChangeLog.fortran-dev =================================================================== --- gcc/testsuite/ChangeLog.fortran-dev (revision 185225) +++ gcc/testsuite/ChangeLog.fortran-dev (working copy) @@ -1,5 +1,10 @@ 2012-03-12 Tobias Burnus + * gfortran.dg/assign_10.f90: Update scan-tree-dump-times. + * gfortran.dg/internal_pack_4.f90: Ditto. + +2012-03-12 Tobias Burnus + * assumed_type_2.f90: Change "data" to "base_addr" in scan-tree-dump. * block_2.f08: Ditto.