From patchwork Thu Feb 1 19:41:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 868398 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-472503-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="GpGmYLKg"; 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 3zXVq21X5Cz9s75 for ; Fri, 2 Feb 2018 06:41:17 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=B4InDpiW9W5A8wCUG/zPXwj7zZ1JGyjSfUGsy7QcnFvb7tu2Ue w9H6m0K3nBywok6YXAmZSfLaDvZr4LjecIvGGA4qzoR0X4xxObRfmb6EeyK8zDaG /6LGYuwnrNyXdAiYOHZbpF6sgVV/LDWsCLm1Fj7OuYoiweBuKNb1PbVFA= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=mpdF86RI/Xbd7SgLgV7PVH1nOSU=; b=GpGmYLKgoRR0rsjX9PBR 0YHpUS3jaszYquN6Cgr0vax3Q7ncTlvrhIg7gniHYmWgcRfXRAoZrfNuBmQhTwlS ZJHF96h/R+JVRTnwlhvU4eAFqpEJP2+K21cpulxQZAwfJhQCujvW3HEWtaATP2bv ZvFMkGOxgGk0H3LqfeY7OUU= Received: (qmail 93188 invoked by alias); 1 Feb 2018 19:41:10 -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 93163 invoked by uid 89); 1 Feb 2018 19:41:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=H*MI:0918, H*M:0918 X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout3.netcologne.de Received: from cc-smtpout3.netcologne.de (HELO cc-smtpout3.netcologne.de) (89.1.8.213) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Feb 2018 19:41:07 +0000 Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id BD0A51282E; Thu, 1 Feb 2018 20:41:04 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin3.netcologne.de (Postfix) with ESMTP id AE3CD11D90; Thu, 1 Feb 2018 20:41:04 +0100 (CET) Received: from [78.35.141.138] (helo=cc-smtpin3.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 5a736d50-02b7-7f0000012729-7f000001b34b-1 for ; Thu, 01 Feb 2018 20:41:04 +0100 Received: from [192.168.178.20] (xdsl-78-35-141-138.netcologne.de [78.35.141.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA; Thu, 1 Feb 2018 20:41:03 +0100 (CET) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran] Fix PR 68560 Message-ID: <97d52e14-12e3-d02f-0918-7483927150af@netcologne.de> Date: Thu, 1 Feb 2018 20:41:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 Hello world, this patch fixes a regression by removing a KIND argument (which is encoded into the function name anyway) from the call to the library function. This extra argument led to an argument mismatch between the front end and the library and between different instances of the same function. Regression-testing as I write this. If it passes (which I expect), OK for trunk? Regards Thomas 2018-02-01 Thomas Koenig PR fortran/68560 * trans-intrinsic.c (gfc_conv_intrinsic_shape): New function. (gfc_conv_intrinsic_function): Call it. 2018-02-01 Thomas Koenig PR fortran/68560 * gfortran.dg/shape_9.f90: New test. Index: trans-intrinsic.c =================================================================== --- trans-intrinsic.c (Revision 257131) +++ trans-intrinsic.c (Arbeitskopie) @@ -5593,6 +5593,25 @@ gfc_conv_intrinsic_ibits (gfc_se * se, gfc_expr * } static void +gfc_conv_intrinsic_shape (gfc_se *se, gfc_expr *expr) +{ + gfc_actual_arglist *s, *k; + gfc_expr *e; + + /* Remove the KIND argument, if present. */ + s = expr->value.function.actual; + k = s->next; + if (k) + { + e = k->expr; + gfc_free_expr (e); + k->expr = NULL; + } + + gfc_conv_intrinsic_funcall (se, expr); +} + +static void gfc_conv_intrinsic_shift (gfc_se * se, gfc_expr * expr, bool right_shift, bool arithmetic) { @@ -8718,6 +8737,10 @@ gfc_conv_intrinsic_function (gfc_se * se, gfc_expr gfc_conv_intrinsic_minmaxloc (se, expr, GT_EXPR); break; + case GFC_ISYM_SHAPE: + gfc_conv_intrinsic_shape (se, expr); + break; + default: gfc_conv_intrinsic_funcall (se, expr); break;