From patchwork Tue Oct 5 10:11:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 66808 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 73586B6EEA for ; Tue, 5 Oct 2010 21:17:01 +1100 (EST) Received: (qmail 1952 invoked by alias); 5 Oct 2010 10:14:40 -0000 Received: (qmail 1440 invoked by uid 22791); 5 Oct 2010 10:14:36 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_NEUTRAL, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp22.services.sfr.fr (HELO smtp22.services.sfr.fr) (93.17.128.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 05 Oct 2010 10:14:26 +0000 Received: from smtp22.services.sfr.fr (msfrf2208 [10.18.26.22]) by msfrf2215.sfr.fr (SMTP Server) with ESMTP id 6F87A700041A; Tue, 5 Oct 2010 12:14:23 +0200 (CEST) Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2208.sfr.fr (SMTP Server) with ESMTP id 67C2F700032A; Tue, 5 Oct 2010 12:11:12 +0200 (CEST) Received: from gimli.local (99.123.193-77.rev.gaoland.net [77.193.123.99]) by msfrf2208.sfr.fr (SMTP Server) with ESMTP id 2EDC97000329; Tue, 5 Oct 2010 12:11:12 +0200 (CEST) X-SFR-UUID: 20101005101112192.2EDC97000329@msfrf2208.sfr.fr MIME-Version: 1.0 From: Mikael Morin To: gfortran , patches Message-ID: <20101005100948.1836.81995@gimli.local> In-Reply-To: <20101005100947.1836.44153@gimli.local> References: <20101005100947.1836.44153@gimli.local> Subject: [Patch, fortran] [13/22] Various minor fixups Date: Tue, 5 Oct 2010 12:11:12 +0200 (CEST) X-IsSubscribed: yes 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 There is no need to clear the lower and upper bounds of gfc_get_array_spec as gfc_get_array_spec returns a cleared struct (and this is not likely to change in the foreseeable future). 2010-10-04 Mikael Morin * array.c (gfc_match_array_spec): Don't re-initialize cleared struct. * symbol.c (gen_shape_param): Ditto. diff --git a/array.c b/array.c index a26be78..8c74e70 100644 --- a/array.c +++ b/array.c @@ -437,16 +437,8 @@ gfc_match_array_spec (gfc_array_spec **asp, bool match_dim, bool match_codim) array_type current_type; gfc_array_spec *as; int i; - - as = gfc_get_array_spec (); - as->corank = 0; - as->rank = 0; - for (i = 0; i < GFC_MAX_DIMENSIONS; i++) - { - as->lower[i] = NULL; - as->upper[i] = NULL; - } + as = gfc_get_array_spec (); if (!match_dim) goto coarray; diff --git a/symbol.c b/symbol.c index cd07b63..aff650c 100644 --- a/symbol.c +++ b/symbol.c @@ -3948,7 +3948,6 @@ gen_shape_param (gfc_formal_arglist **head, gfc_symtree *param_symtree = NULL; gfc_formal_arglist *formal_arg = NULL; const char *shape_param = "gfc_shape_array__"; - int i; if (shape_param_name != NULL) shape_param = shape_param_name; @@ -3974,15 +3973,9 @@ gen_shape_param (gfc_formal_arglist **head, /* Initialize the kind to default integer. However, it will be overridden during resolution to match the kind of the SHAPE parameter given as the actual argument (to allow for any valid integer kind). */ - param_sym->ts.kind = gfc_default_integer_kind; + param_sym->ts.kind = gfc_default_integer_kind; param_sym->as = gfc_get_array_spec (); - /* Clear out the dimension info for the array. */ - for (i = 0; i < GFC_MAX_DIMENSIONS; i++) - { - param_sym->as->lower[i] = NULL; - param_sym->as->upper[i] = NULL; - } param_sym->as->rank = 1; param_sym->as->lower[0] = gfc_get_int_expr (gfc_default_integer_kind, NULL, 1);