From patchwork Fri Nov 12 14:37:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 47531 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 64FD13857C60 for ; Fri, 12 Nov 2021 14:38:06 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 674B03858402 for ; Fri, 12 Nov 2021 14:37:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 674B03858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 9920A21982 for ; Fri, 12 Nov 2021 14:37:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1636727869; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zpTBAKFEDlQX6BGg1uKbk1VDxQ139lSlf1eQcYRCACs=; b=gJqV6glHau6psYTu9OQXgchkCcjd20ELdaizWm+MFVKLOviRQlVUcbDkUrYsyR3MBvPPCU xGOdAmVnxL+C61YKo5mFgzUSwMNduoRsGgggsUrIXvdv/3EeJ2KZJCIoquD7x0Txg1FatO 1CSFl5maB1IK1EDrwtZ0SZGUkLgfk38= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1636727869; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zpTBAKFEDlQX6BGg1uKbk1VDxQ139lSlf1eQcYRCACs=; b=437tOROiUbWQmCHrS8Un10cXEVdlECJQf6qoWkhk4RZAyZ3W7NKjK3L2Eo2SEa9TBCC1Bg LvCkauiULPDpMlBg== Received: from suse.cz (virgil.suse.cz [10.100.13.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 842C5A3B87 for ; Fri, 12 Nov 2021 14:37:49 +0000 (UTC) From: Martin Jambor To: GCC Patches Subject: [PATCH] Fortran: Use build_debug_expr_decl to create DEBUG_DECL_EXPRs In-Reply-To: References: User-Agent: Notmuch/0.33.2 (https://notmuchmail.org) Emacs/27.2 (x86_64-suse-linux-gnu) Date: Fri, 12 Nov 2021 15:37:49 +0100 Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Hi, This patch converts one more open coded construction of a DEBUG_EXPR_DECL to a call of build_debug_expr_decl that I missed in my previous patch because it happens to be in the Fortran front-end. Bootstrapped and tested on x86_64-linux. Since this should have been done by an earlier approved patch, I consider it also approved and will commit it in a moment. Thanks, Martin gcc/fortran/ChangeLog: 2021-11-11 Martin Jambor * trans-types.c (gfc_get_array_descr_info): Use build_debug_expr_decl instead of building DEBUG_EXPR_DECL manually. --- gcc/fortran/trans-types.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 947ab5a099b..e5d36d5a58f 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -3417,10 +3417,8 @@ gfc_get_array_descr_info (const_tree type, struct array_descr_info *info) base_decl = GFC_TYPE_ARRAY_BASE_DECL (type, indirect); if (!base_decl) { - base_decl = make_node (DEBUG_EXPR_DECL); - DECL_ARTIFICIAL (base_decl) = 1; - TREE_TYPE (base_decl) = indirect ? build_pointer_type (ptype) : ptype; - SET_DECL_MODE (base_decl, TYPE_MODE (TREE_TYPE (base_decl))); + base_decl = build_debug_expr_decl (indirect + ? build_pointer_type (ptype) : ptype); GFC_TYPE_ARRAY_BASE_DECL (type, indirect) = base_decl; } info->base_decl = base_decl;