From patchwork Thu Jun 27 21:33:14 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 255229 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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id A5E162C0096 for ; Fri, 28 Jun 2013 07:33:26 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; q=dns; s= default; b=B4XPQUwVC6sLWPHSjjb+lAozBpDDmFOhhruznhXXe2QFj3KMKbE97 LyZGDajEoc7loNDwZ5g7SnwjdcxLyhfePJNlO7sCnz03O415DnbUrg7hcDRlgiSN ZT3U4Ewe467l0pjITQkXmpGI7yd5ODFmGSN90kAsvO5M0H/pzpf47w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type:content-transfer-encoding; s=default; bh=Vf5lzo2ImKGn2dyaTzCNKeUY284=; b=FmznZ7IAeeywL1g4ae0C8aINdLt3 ag6VeeNQi/9A89vxJH8fGOopB04SpEmsipU3CBQYotkJNwJvKP7pfByc6l+BuTNV Hw9N0AFOij8PguzERraUxQk45nto/j0bs4pG26RWRxYZsYw8UCsyw0Lcx2+EaJId 6J7zo6NgrbFhpWQ= Received: (qmail 11795 invoked by alias); 27 Jun 2013 21:33:20 -0000 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 Received: (qmail 11781 invoked by uid 89); 27 Jun 2013 21:33:20 -0000 X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL, BAYES_00, KHOP_THREADED, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 27 Jun 2013 21:33:18 +0000 Received: from archimedes.net-b.de (port-92-206-14-23.dynamic.qsc.de [92.206.14.23]) by mx01.qsc.de (Postfix) with ESMTP id 84D593D0C0; Thu, 27 Jun 2013 23:33:14 +0200 (CEST) Message-ID: <51CCAF9A.4060603@net-b.de> Date: Thu, 27 Jun 2013 23:33:14 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Thomas Koenig CC: "fortran@gcc.gnu.org" , gcc-patches Subject: Re: [patch, fortran] PR 50554 - redefinition of index variable with inquire(iolength=...) References: <51CC89EB.4010703@netcologne.de> In-Reply-To: <51CC89EB.4010703@netcologne.de> Thomas Koenig wrote: > the attached patch raises an error if an index variable is redefined > with inquire(iolength=...). > > * frontend-passes.c (doloop_code): Check do loop variables for > EXEC_IOLENGTH. What's the advantage to place it into doloop_code rather than using - as Steve's patch in the PR - gfc_check_do_variable. Your version looks much more complicated, adding a special case for IOLENGTH. His version is already used, e.g., for match_out_tag in io.c - which is about nearly all intent(out) integer items in IO statements. Actually, I wonder whether the following (untested) shouldn't be sufficient: Tobias --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -3892,3 +3892,3 @@ match_inquire_element (gfc_inquire *inquire) RETM m = match_vtag (&tag_s_decimal, &inquire->decimal); - RETM m = match_vtag (&tag_size, &inquire->size); + RETM m = match_out_tag (&tag_size, &inquire->size); RETM m = match_vtag (&tag_s_encoding, &inquire->encoding); @@ -3897,3 +3897,3 @@ match_inquire_element (gfc_inquire *inquire) RETM m = match_vtag (&tag_s_pad, &inquire->pad); - RETM m = match_vtag (&tag_iolength, &inquire->iolength); + RETM m = match_out_tag (&tag_iolength, &inquire->iolength); RETM m = match_vtag (&tag_convert, &inquire->convert);