From patchwork Wed Feb 23 11:14:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 51330 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 B2C5D394880F for ; Wed, 23 Feb 2022 11:17:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B2C5D394880F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1645615055; bh=CK44elgWcvMX2kvuzJFVvWtfRF1QgCGIgfFfEtaeMrs=; h=Date:Subject:To:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=OptbaYHh657iboQuWXti+FLg9WNC/RHfWjg+TiVXVPDTphQ29LfNGKDF4us53FITd Hc0DVTlgvTf30Of37AGTX6E2kY0SP6HR0/6fq93hfQNkp0yLjR0b0qHDPViuOouZta jxle/VOuY9mQio1vLklO0PZFDV0J0xDJb55mkjvc= 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 A11E53948820 for ; Wed, 23 Feb 2022 11:14:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A11E53948820 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id D613721634 for ; Wed, 23 Feb 2022 11:14:57 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C47CF13D36 for ; Wed, 23 Feb 2022 11:14:57 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mlaTLjEXFmJhYAAAMHmgww (envelope-from ) for ; Wed, 23 Feb 2022 11:14:57 +0000 Message-ID: <4f7dbb4e-1586-4a95-5588-794d739b6125@suse.de> Date: Wed, 23 Feb 2022 12:14:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: [PATCH][nvptx] Fix dummy location in gen_comment Content-Language: en-US To: gcc-patches@gcc.gnu.org References: <20220222135337.GA1196@delia.home> In-Reply-To: <20220222135337.GA1196@delia.home> X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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: , X-Patchwork-Original-From: Tom de Vries via Gcc-patches From: Tom de Vries Reply-To: Tom de Vries Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" [ Re: [committed][nvptx] Add -mptx-comment ] On 2/22/22 14:53, Tom de Vries wrote: > Hi, > > Add functionality that indicates which insns are added by -minit-regs, such > that for instance we have for pr53465.s: > ... > // #APP > // 9 "gcc/testsuite/gcc.c-torture/execute/pr53465.c" 1 > // Start: Added by -minit-regs=3: > // #NO_APP > mov.u32 %r26, 0; > // #APP > // 9 "gcc/testsuite/gcc.c-torture/execute/pr53465.c" 1 > // End: Added by -minit-regs=3: > // #NO_APP > ... > > Can be switched off using -mno-ptx-comment. > > Tested on nvptx. But tested in combination with another patch, which is still waiting for review. This patch by itself caused some regressions, currently testing attached fix. Thanks, - Tom [nvptx] Fix dummy location in gen_comment I committed "[nvptx] Add -mptx-comment", but tested it in combination with the proposed "[final] Handle compiler-generated asm insn" ( https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590721.html ), so by itself the commit introduced some regressions: ... FAIL: gcc.dg/20020426-2.c (internal compiler error: Segmentation fault) FAIL: gcc.dg/analyzer/zlib-3.c (internal compiler error: Segmentation fault) FAIL: gcc.dg/pr101223.c (internal compiler error: Segmentation fault) FAIL: gcc.dg/torture/pr80764.c -O2 (internal compiler error: Segmentation fault) ... There are due to cfun->function_start_locus == 0. Fix these by using DECL_SOURCE_LOCATION (cfun->decl) instead. Tested on nvptx. gcc/ChangeLog: 2022-02-23 Tom de Vries * config/nvptx/nvptx.cc (gen_comment): Use DECL_SOURCE_LOCATION (cfun->decl) instead of cfun->function_start_locus. --- gcc/config/nvptx/nvptx.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/config/nvptx/nvptx.cc b/gcc/config/nvptx/nvptx.cc index 858789e6df76..6f6d592e4621 100644 --- a/gcc/config/nvptx/nvptx.cc +++ b/gcc/config/nvptx/nvptx.cc @@ -5382,7 +5382,7 @@ gen_comment (const char *s) char *comment = (char *) alloca (len); snprintf (comment, len, "%s%s%s", ASM_COMMENT_START, sep, s); return gen_rtx_ASM_INPUT_loc (VOIDmode, ggc_strdup (comment), - cfun->function_start_locus); + DECL_SOURCE_LOCATION (cfun->decl)); } /* Initialize all declared regs at function entry.