From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22606 invoked by alias); 15 Sep 2011 23:08:36 -0000 Received: (qmail 22563 invoked by uid 22791); 15 Sep 2011 23:08:34 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp22.services.sfr.fr (HELO smtp22.services.sfr.fr) (93.17.128.11) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Sep 2011 23:08:17 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2208.sfr.fr (SMTP Server) with ESMTP id 0452B700016B; Fri, 16 Sep 2011 01:08:16 +0200 (CEST) Received: from gimli.local (118.183.72.86.rev.sfr.net [86.72.183.118]) by msfrf2208.sfr.fr (SMTP Server) with ESMTP id BEB0D700015C; Fri, 16 Sep 2011 01:08:15 +0200 (CEST) X-SFR-UUID: 20110915230815781.BEB0D700015C@msfrf2208.sfr.fr Content-Type: multipart/mixed; boundary="===============0435031103480955420==" MIME-Version: 1.0 From: Mikael Morin To: gfortran , GCC patches Message-ID: <20110915230815.28513.40130@gimli.local> In-Reply-To: <20110915230813.28513.97419@gimli.local> References: <20110915230813.28513.97419@gimli.local> Subject: [Patch, fortran] [01/21] Remove coarray support in the scalarizer: Remove is_coarray Date: Thu, 15 Sep 2011 23:09:00 -0000 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00923.txt.bz2 --===============0435031103480955420== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-length: 367 There are two functions checking that an expression is a coarray. This keeps the public one (which seems to be the more complete) and removes the other one. OK? PS: As this changes a rejects-valid into an ice-on-valid (see PR 50420 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50420), it can be delayed if preferred; unfortunately, patch 14 fails without this one. --===============0435031103480955420== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="no_coarray_in_scalarizer-1.CL" Content-length: 120 2011-09-14 Mikael Morin * check.c (is_coarray): Remove. (coarray_check): Use gfc_is_coarray. --===============0435031103480955420== Content-Type: text/x-diff; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="no_coarray_in_scalarizer-1.diff" Content-length: 1157 diff --git a/check.c b/check.c index 3d4f4c8..81f7b30 100644 --- a/check.c +++ b/check.c @@ -203,42 +203,10 @@ double_check (gfc_expr *d, int n) } -/* Check whether an expression is a coarray (without array designator). */ - -static bool -is_coarray (gfc_expr *e) -{ - bool coarray = false; - gfc_ref *ref; - - if (e->expr_type != EXPR_VARIABLE) - return false; - - coarray = e->symtree->n.sym->attr.codimension; - - for (ref = e->ref; ref; ref = ref->next) - { - if (ref->type == REF_COMPONENT) - coarray = ref->u.c.component->attr.codimension; - else if (ref->type != REF_ARRAY || ref->u.ar.dimen != 0) - coarray = false; - else if (ref->type == REF_ARRAY && ref->u.ar.codimen != 0) - { - int n; - for (n = 0; n < ref->u.ar.codimen; n++) - if (ref->u.ar.dimen_type[n] != DIMEN_THIS_IMAGE) - coarray = false; - } - } - - return coarray; -} - - static gfc_try coarray_check (gfc_expr *e, int n) { - if (!is_coarray (e)) + if (!gfc_is_coarray (e)) { gfc_error ("Expected coarray variable as '%s' argument to the %s " "intrinsic at %L", gfc_current_intrinsic_arg[n]->name, --===============0435031103480955420==--