From patchwork Tue Nov 5 14:41:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1189723 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-512507-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=net-b.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="rSYHZG51"; 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 476sml6c9Vz9sNx for ; Wed, 6 Nov 2019 01:41:25 +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=lwAvUma33xlX2w6EkC3JKvotUtEoP5eLd5Q7jo2f15rD6dwjgA xSzi/A4l4Vzk1eJCXp4HuX2bgrvDJZNinnHs2RxxlRxdv29K7UdTSuX1Nrumizg5 eqafL4ppIoLnE3c5W1QWcH0+RJ0ZoPfBOxlAQXG4avkt0tImAy8WxiWjY= 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=Gtbf9CkIZnVsbeLQz5nBSVdcYHU=; b=rSYHZG51GwqgMOU8IrVn bIud3gjUpI6oi1psk9qg7VLMic+FNifZsazsne7ZXPnlk+rdmcSklecdqHQNBV3o 61FVGran1ygqS7J9uWKrPHYRMCfBZNVhBwqPdHK/kkB5RQKm0hQBoS+yT/T81crg FSovb78aEp8BKOks8yGq9qU= Received: (qmail 1251 invoked by alias); 5 Nov 2019 14:41:14 -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 1233 invoked by uid 89); 5 Nov 2019 14:41:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.0 required=5.0 tests=AWL, BAYES_00, GARBLED_SUBJECT, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=H*Ad:U*burnus, gfc_symbol X-HELO: mx-relay72-hz2.antispameurope.com Received: from mx-relay72-hz2.antispameurope.com (HELO mx-relay72-hz2.antispameurope.com) (94.100.136.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Nov 2019 14:41:12 +0000 Received: from s041.bre.qsc.de ([195.90.7.81]) by mx-relay72-hz2.antispameurope.com; Tue, 05 Nov 2019 15:41:04 +0100 Received: from localhost.localdomain (nat-dem.mentorg.com [139.181.48.2]) by s041.bre.qsc.de (Postfix) with ESMTPSA id 8F41D2C00BE; Tue, 5 Nov 2019 15:41:01 +0100 (CET) To: gcc-patches , fortran From: Tobias Burnus Subject: =?utf-8?q?=5BPatch=5D=5Bcommitted=5D_PR_92208_+_PR_92277_?= =?utf-8?q?=E2=80=93_GCC_9_follow-up_fix?= Message-ID: <61238c24-29d9-262a-fefb-0673d5f77ee6@net-b.de> Date: Tue, 5 Nov 2019 15:41:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.0 MIME-Version: 1.0 X-cloud-security-sender: burnus@net-b.de X-cloud-security-recipient: gcc-patches@gcc.gnu.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mx-relay72-hz2.antispameurope.com with 0D55E829E14 X-cloud-security-connect: s041.bre.qsc.de[195.90.7.81], TLS=1, IP=195.90.7.81 X-cloud-security: scantime:.6526 For trunk, I needed the DECL_ARTIFICIAL fix, cf. Rev. 277661 of PR92277, i.e. https://gcc.gnu.org/ml/gcc-patches/2019-10/msg02148.html When back-porting some patches, I did not include this part – only its test case – as I couldn't trigger the ICE. Well, as the comments in PR 92208 show, the issue is also latent on GCC 9, but it only triggers on arm and aarch64. Hence, I have now applied also the code change from PR 92277. Committed as Rev. 277840. Cheers, Tobias commit 41957bfcc2982ba3e3d047f95cffc39e468a0904 Author: burnus Date: Tue Nov 5 14:28:07 2019 +0000 PR 92208 + PR 92277 – GCC 9 follow-up fix PR fortran/92208 Backport from mainline 2019-10-31 Tobias Burnus PR fortran/92277 * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Fix DECL_ARTIFICIAL checking. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-9-branch@277840 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e8ab85fc424..a9369691722 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,13 @@ +2019-11-05 Tobias Burnus + + PR fortran/92208 + Backport from mainline + 2019-10-31 Tobias Burnus + + PR fortran/92277 + * trans-expr.c (gfc_conv_gfc_desc_to_cfi_desc): Fix DECL_ARTIFICIAL + checking. + 2019-11-04 Tobias Burnus Backport from mainline diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 245e656a1f8..52a8cdd6902 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -5027,6 +5027,10 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym) parmse->expr = build_fold_indirect_ref_loc (input_location, parmse->expr); + bool is_artificial = (INDIRECT_REF_P (parmse->expr) + ? DECL_ARTIFICIAL (TREE_OPERAND (parmse->expr, 0)) + : DECL_ARTIFICIAL (parmse->expr)); + /* Unallocated allocatable arrays and unassociated pointer arrays need their dtype setting if they are argument associated with assumed rank dummies. */ @@ -5045,7 +5049,7 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym) type = e->ts.type != BT_ASSUMED ? gfc_typenode_for_spec (&e->ts) : NULL_TREE; - if (type && DECL_ARTIFICIAL (parmse->expr) + if (type && is_artificial && type != gfc_get_element_type (TREE_TYPE (parmse->expr))) { /* Obtain the offset to the data. */ @@ -5057,8 +5061,7 @@ gfc_conv_gfc_desc_to_cfi_desc (gfc_se *parmse, gfc_expr *e, gfc_symbol *fsym) gfc_conv_descriptor_dtype (parmse->expr), gfc_get_dtype_rank_type (e->rank, type)); } - else if (type == NULL_TREE - || (!is_subref_array (e) && !DECL_ARTIFICIAL (parmse->expr))) + else if (type == NULL_TREE || (!is_subref_array (e) && !is_artificial)) { /* Make sure that the span is set for expressions where it might not have been done already. */