From patchwork Thu Sep 20 21:24:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernhard Reutner-Fischer X-Patchwork-Id: 972746 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-486097-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="hBoT3pVb"; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="s0vWmwHn"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42GVBc38mRz9s89 for ; Fri, 21 Sep 2018 07:25:26 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; q=dns; s=default; b=ycciVQ1NL5gx04Y6 xDnQ5Wcvgb+e+6uy86AEogUuiSeXKPLATPf2JeD3LxBUoL4+4GBVAvcuGq/c0F4n KNX4hqULK+rZYKdWKu/y5KFycTGWh/sZUfQs3XBu62BdrDtj/Av7Nnsl+IUju0aF T5ZK4KE32dV2YPfGHD0iA9T+GwQ= 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:from :to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=default; bh=C9KpO6hJlLMsyNf32PoEES tkHeE=; b=hBoT3pVbkoLagi9ZVx4iRd1cTUnVbWSBBTOgKQi0osXWCskvN/CVUO V1f2rfpmpVU2qNqYlKEdstNoWTvtkZWTYoKw/amYy0NNpAf6uWJ7RA3q0dScsizw 6y2wKXLg93LVLpNoaAfyWS0rL1V4Vpvb827Gmkro9bOzti7yLwPXI= Received: (qmail 37703 invoked by alias); 20 Sep 2018 21:25:18 -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 37682 invoked by uid 89); 20 Sep 2018 21:25:17 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=coarrays, fcoarray, rank, HContent-Transfer-Encoding:8bit X-HELO: mail-wr1-f48.google.com Received: from mail-wr1-f48.google.com (HELO mail-wr1-f48.google.com) (209.85.221.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 20 Sep 2018 21:25:13 +0000 Received: by mail-wr1-f48.google.com with SMTP id e1-v6so10834105wrt.3; Thu, 20 Sep 2018 14:25:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8kB9ALGZ3hauWXIo3i+apKSh6z65eyGsTsr9iUVh6eI=; b=s0vWmwHns/f/a34KSPI77RNOF/6Dvxd5TKsKauMdpplCoho9tGG4Vt0M8b4yjtzOhK 5WBNjwgeuFmrSBcECakRoBxgmyTfdnZEM7dkkOj1BsZfnY0JMmsuJSgQ2SPTXw2jFcaA AD7ZfGtsLgZ7sv1UgSoVJ/59f0zZC8PP05b7HKUcTQqOIBZR17LxwsvpDqQgFc0q7x4W /R+cmgJFb41tuoJSqVoNUi2rHzwYDrjcOMvgdVmmzqThRiou/1F8TgqzuUAlOJjqNTGj +VZIwL9ooNXRIjl2BZPeYKbPixOBE2Ti9hwo4cAozob4IDo3sm7LG0+PPjIj4/Hx0iKX WQpA== Received: from nbbrfq.loc (91-119-125-11.dsl.dynamic.surfer.at. [91.119.125.11]) by smtp.gmail.com with ESMTPSA id x23-v6sm2050615wmh.26.2018.09.20.14.25.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 20 Sep 2018 14:25:09 -0700 (PDT) Received: from b by nbbrfq.loc with local (Exim 4.91) (envelope-from ) id 1g36Rg-0005gM-Ah; Thu, 20 Sep 2018 23:25:08 +0200 From: Bernhard Reutner-Fischer To: fortran@gcc.gnu.org Cc: Bernhard Reutner-Fischer , gcc-patches@gcc.gnu.org Subject: [PATCH,FORTRAN] Tweak locations around CAF simplify Date: Thu, 20 Sep 2018 23:24:59 +0200 Message-Id: <20180920212459.21789-1-rep.dot.nop@gmail.com> MIME-Version: 1.0 X-IsSubscribed: yes addresses: FIXME: gfc_current_locus is wrong. by using the locus of the current intrinsic. Regtests clean, ok for trunk? gcc/fortran/ChangeLog: 2018-09-20 Bernhard Reutner-Fischer * simplify.c (gfc_simplify_failed_or_stopped_images): Use current intrinsic where locus. (gfc_simplify_get_team): Likewise. (gfc_simplify_num_images): Likewise. (gfc_simplify_image_status): Likewise. (gfc_simplify_this_image): Likewise. --- gcc/fortran/simplify.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index d35bbbaaa1b..4ce91235e2d 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -2905,8 +2905,9 @@ gfc_simplify_failed_or_stopped_images (gfc_expr *team ATTRIBUTE_UNUSED, { if (flag_coarray == GFC_FCOARRAY_NONE) { - gfc_current_locus = *gfc_current_intrinsic_where; - gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable"); + gfc_fatal_error ("Coarrays disabled at %L, use %<-fcoarray=%> to enable", + gfc_current_intrinsic_where); + return &gfc_bad_expr; } @@ -2919,7 +2920,8 @@ gfc_simplify_failed_or_stopped_images (gfc_expr *team ATTRIBUTE_UNUSED, else actual_kind = gfc_default_integer_kind; - result = gfc_get_array_expr (BT_INTEGER, actual_kind, &gfc_current_locus); + result = gfc_get_array_expr (BT_INTEGER, actual_kind, + gfc_current_intrinsic_where); result->rank = 1; return result; } @@ -2935,15 +2937,16 @@ gfc_simplify_get_team (gfc_expr *level ATTRIBUTE_UNUSED) { if (flag_coarray == GFC_FCOARRAY_NONE) { - gfc_current_locus = *gfc_current_intrinsic_where; - gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable"); + gfc_fatal_error ("Coarrays disabled at %L, use %<-fcoarray=%> to enable", + gfc_current_intrinsic_where); return &gfc_bad_expr; } if (flag_coarray == GFC_FCOARRAY_SINGLE) { gfc_expr *result; - result = gfc_get_array_expr (BT_INTEGER, gfc_default_integer_kind, &gfc_current_locus); + result = gfc_get_array_expr (BT_INTEGER, gfc_default_integer_kind, + gfc_current_intrinsic_where); result->rank = 0; return result; } @@ -5785,7 +5788,8 @@ gfc_simplify_num_images (gfc_expr *distance ATTRIBUTE_UNUSED, gfc_expr *failed) if (flag_coarray == GFC_FCOARRAY_NONE) { - gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable"); + gfc_fatal_error ("Coarrays disabled at %L, use %<-fcoarray=%> to enable", + gfc_current_intrinsic_where); return &gfc_bad_expr; } @@ -5795,9 +5799,8 @@ gfc_simplify_num_images (gfc_expr *distance ATTRIBUTE_UNUSED, gfc_expr *failed) if (failed && failed->expr_type != EXPR_CONSTANT) return NULL; - /* FIXME: gfc_current_locus is wrong. */ result = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, - &gfc_current_locus); + gfc_current_intrinsic_where); if (failed && failed->value.logical != 0) mpz_set_si (result->value.integer, 0); @@ -7678,8 +7681,8 @@ gfc_simplify_image_status (gfc_expr *image, gfc_expr *team ATTRIBUTE_UNUSED) { if (flag_coarray == GFC_FCOARRAY_NONE) { - gfc_current_locus = *gfc_current_intrinsic_where; - gfc_fatal_error ("Coarrays disabled at %C, use %<-fcoarray=%> to enable"); + gfc_fatal_error ("Coarrays disabled at %L, use %<-fcoarray=%> to enable", + gfc_current_intrinsic_where); return &gfc_bad_expr; } @@ -7716,9 +7719,8 @@ gfc_simplify_this_image (gfc_expr *coarray, gfc_expr *dim, if (coarray == NULL || !gfc_is_coarray (coarray)) { gfc_expr *result; - /* FIXME: gfc_current_locus is wrong. */ result = gfc_get_constant_expr (BT_INTEGER, gfc_default_integer_kind, - &gfc_current_locus); + gfc_current_intrinsic_where); mpz_set_si (result->value.integer, 1); return result; }