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: 1596610 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=c9kRl532; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K3YRG04tBz9sG2 for ; Wed, 23 Feb 2022 22:17:30 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B31E1385AC26 for ; Wed, 23 Feb 2022 11:17:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B31E1385AC26 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1645615046; 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=c9kRl5325sbFTnedT0UCjkp8X7ucjy+QXPEg0uz/sQ5DYZxucouG0Ztfw2CD+GY/a tnngG/QsCuJXy5aL/qMyPXkEMTrFfcV3r59pxfUfNYMsb7A887kQtmlBvq0hh5NA0P IVJAn6BddgDiIQANOctrv3cJfyxW4mZee98VjqVo= 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+incoming=patchwork.ozlabs.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.