From patchwork Sun Oct 13 13:47:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Thomas_K=C3=B6nig?= X-Patchwork-Id: 1175843 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-510871-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tkoenig.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="NcsSSp/V"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=tkoenig.net header.i=@tkoenig.net header.b="HEhzqgUh"; 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 46rjgb4TVfz9sP3 for ; Mon, 14 Oct 2019 00:47:53 +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=AaIXJthOK8jT493qge9X2lQMYaPB0ES0OrCNf+NW3JeQYdkmub DhWf8TM5rz8Du3wNnL0qYTpkZkqm9jkZswIx9PjWJuWuJFDZwqyO5Qv7Rse24pOV bzsGig44WsY1feJurLytLgJIMtxT3u+HIzuD903drC3m4AUgi7N1spbUk= 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=thTcQWsmrew7LD7SefHZ48ibP90=; b=NcsSSp/VoSLZflUtW5nq 1GZt8229+XNXP3+tH9hgGwanIVodiM6ETdtLEhaNACImkDIakkkBvxFjPSDo7G3f dQoGVzsnU2IT+EY0sdkrhEIi2DSCoo23oG5Zsfdfo3lt6O7Gu8/Ih98zvjwxtQNs oOrKsyvlxQpU/+ZYswBOgFU= Received: (qmail 64796 invoked by alias); 13 Oct 2019 13:47:42 -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 64780 invoked by uid 89); 13 Oct 2019 13:47:42 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=UD:cl, yourself X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (85.215.255.23) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 13 Oct 2019 13:47:38 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1570974456; s=strato-dkim-0002; d=tkoenig.net; h=Date:Message-ID:Subject:From:To:X-RZG-CLASS-ID:X-RZG-AUTH:From: Subject:Sender; bh=23Ws2Ddd6R5O3gTm5CrBlAgOpV0o1YICMqpEsI2enGc=; b=HEhzqgUhM3JYv0I+bBpeRjBBMKLqUOjX9JGVsSjeASiVjQWwgaXm8h9vJf6c9M4Yp4 JgLHt4Lp+CKkemo7uxmaGiX3MbKA07Vsi2vWD6fGNNnTywnwlVHY5xO9lYz5HP3Pgo3T IZKV1q7YdOjPUWAYlwmYBYgL7Q7h4tPjW/KlwNsfwqB2kPBPpkqdEiNKVC2M4THIfnSg oPXUGS4IGm2L8Xh0x1kd42c+y+xm7mUuOzmeDa8pc2wAt4xGwc5zXjlc7li9/hjFIV0O JmSnTVKhj0wTtgIa1uAkK0sgBp1rz9Z5Dbg/B20treOI0yx/jNREPYIuOC2n7XpT7/UI P/Gg== Received: from [IPv6:2001:4dd4:c310:0:7285:c2ff:fe6c:992d] by smtp.strato.de (RZmta 44.28.0 AUTH) with ESMTPSA id Z05425v9DDlZiG4 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sun, 13 Oct 2019 15:47:35 +0200 (CEST) To: "fortran@gcc.gnu.org" , gcc-patches From: =?utf-8?q?Thomas_K=C3=B6nig?= Subject: [patch, fortran, committed] Fix PR 92017 Message-ID: <6dba264c-e865-6874-d91c-0e228834343b@tkoenig.net> Date: Sun, 13 Oct 2019 15:47:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 Hello world, I have committed the attached patch as obvious and simple after regression-testing. It fixes an ICE on valid for a corner case, so I don't really feel that it needs to be backported. If anybody disagrees, please speak up (or do it yourself :-) Regards Thomas 2019-10-13 Thomas Koenig PR fortran/92017 * expr.c (simplify_parameter_variable): Set the character length of the result expression from the original expression if necessary. 2019-10-13 Thomas Koenig PR fortran/92017 * gfortran.dg/minmaxloc_14.f90: New test. Index: expr.c =================================================================== --- expr.c (Revision 276937) +++ expr.c (Arbeitskopie) @@ -2066,6 +2066,9 @@ simplify_parameter_variable (gfc_expr *p, int type e->rank = p->rank; + if (e->ts.type == BT_CHARACTER && e->ts.u.cl == NULL) + e->ts.u.cl = gfc_new_charlen (gfc_current_ns, p->ts.u.cl); + /* Do not copy subobject refs for constant. */ if (e->expr_type != EXPR_CONSTANT && p->ref != NULL) e->ref = gfc_copy_ref (p->ref);