Message ID | 4f7dbb4e-1586-4a95-5588-794d739b6125@suse.de |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> 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 <patchwork@sourceware.org>; 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 <gcc-patches@gcc.gnu.org>; 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 <gcc-patches@gcc.gnu.org>; 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 <gcc-patches@gcc.gnu.org>; 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 <tdevries@suse.de>) for <gcc-patches@gcc.gnu.org>; Wed, 23 Feb 2022 11:14:57 +0000 Content-Type: multipart/mixed; boundary="------------f3qqjL7HySEnlMeNNSXxVCIe" 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Tom de Vries via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Tom de Vries <tdevries@suse.de> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
[nvptx] Fix dummy location in gen_comment
|
|
Commit Message
Tom de Vries
Feb. 23, 2022, 11:14 a.m. UTC
[ 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
Comments
Hi! On 2022-02-23T12:14:57+0100, Tom de Vries via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: > [ Re: [committed][nvptx] Add -mptx-comment ] > > On 2/22/22 14:53, Tom de Vries wrote: >> 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 I'd just begun analyzing and determined that it was commit c2b23aaaf4457278403c01cd145cd3936683384e "[nvptx] Add -mptx-comment" that causes a load of FAILs in nvptx offloading testing: Program received signal SIGSEGV, Segmentation fault. 0x000000000084abad in final_scan_insn_1 (insn=insn@entry=0x7ffff7380940, file=file@entry=0x1f50c40, optimize_p=optimize_p@entry=0, nopeepholes=nopeepholes@entry=0, seen=seen@entry=0x7fffffffd07c) at [...]/source-gcc/gcc/final.cc:2650 2650 if (*loc.file && loc.line) (gdb) print loc $1 = {file = 0x0, line = 0, column = 0, data = 0x0, sysp = false} (gdb) bt #0 0x000000000084abad in final_scan_insn_1 (insn=insn@entry=0x7ffff7380940, file=file@entry=0x1f50c40, optimize_p=optimize_p@entry=0, nopeepholes=nopeepholes@entry=0, seen=seen@entry=0x7fffffffd07c) at [...]/source-gcc/gcc/final.cc:2650 #1 0x000000000084b86a in final_scan_insn (insn=insn@entry=0x7ffff7380940, file=file@entry=0x1f50c40, optimize_p=optimize_p@entry=0, nopeepholes=nopeepholes@entry=0, seen=seen@entry=0x7fffffffd07c) at [...]/source-gcc/gcc/final.cc:2942 #2 0x000000000084823a in final_1 (first=0x7ffff74631c0, file=0x1f50c40, seen=1, optimize_p=0) at [...]/source-gcc/gcc/final.cc:1999 #3 0x000000000085091a in rest_of_handle_final () at [...]/source-gcc/gcc/final.cc:4287 #4 0x0000000000850de4 in (anonymous namespace)::pass_final::execute (this=0x1f4bd00) at [...]/source-gcc/gcc/final.cc:4365 #5 0x0000000000b781b1 in execute_one_pass (pass=pass@entry=0x1f4bd00) at [...]/source-gcc/gcc/passes.cc:2639 #6 0x0000000000b7855a in execute_pass_list_1 (pass=0x1f4bd00) at [...]/source-gcc/gcc/passes.cc:2739 #7 0x0000000000b7858d in execute_pass_list_1 (pass=0x1f4b820) at [...]/source-gcc/gcc/passes.cc:2740 #8 0x0000000000b7858d in execute_pass_list_1 (pass=0x1f49d20, pass@entry=0x1f45780) at [...]/source-gcc/gcc/passes.cc:2740 #9 0x0000000000b785e9 in execute_pass_list (fn=0x7ffff72e1e40, pass=0x1f45780) at [...]/source-gcc/gcc/passes.cc:2750 #10 0x0000000000732a66 in cgraph_node::expand (this=0x7ffff72efbb0) at [...]/source-gcc/gcc/cgraphunit.cc:1836 #11 0x000000000073336a in cgraph_order_sort::process (this=0x20730f8) at [...]/source-gcc/gcc/cgraphunit.cc:2075 #12 0x00000000007336f4 in output_in_order () at [...]/source-gcc/gcc/cgraphunit.cc:2143 #13 0x0000000000733dbe in symbol_table::compile (this=0x7ffff7542000) at [...]/source-gcc/gcc/cgraphunit.cc:2347 #14 0x000000000065d79b in lto_main () at [...]/source-gcc/gcc/lto/lto.cc:655 #15 0x0000000000c709e6 in compile_file () at [...]/source-gcc/gcc/toplev.cc:454 #16 0x0000000000c73abb in do_compile (no_backend=no_backend@entry=false) at [...]/source-gcc/gcc/toplev.cc:2160 #17 0x0000000000c73ea6 in toplev::main (this=this@entry=0x7fffffffd4b0, argc=argc@entry=16, argv=0x1f1db40, argv@entry=0x7fffffffd5b8) at [...]/source-gcc/gcc/toplev.cc:2312 #18 0x000000000174fe5f in main (argc=16, argv=0x7fffffffd5b8) at [...]/source-gcc/gcc/main.cc:41 > currently testing attached > fix. Per the test results that I've got so far (but is still running), your proposed fix does resolve the SIGSEGVs, thanks. Grüße Thomas > [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 <tdevries@suse.de> > > * 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. ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955
On 2/23/22 12:58, Thomas Schwinge wrote: > Hi! > > On 2022-02-23T12:14:57+0100, Tom de Vries via Gcc-patches <gcc-patches@gcc.gnu.org> wrote: >> [ Re: [committed][nvptx] Add -mptx-comment ] >> >> On 2/22/22 14:53, Tom de Vries wrote: >>> 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 > > I'd just begun analyzing and determined that it was > commit c2b23aaaf4457278403c01cd145cd3936683384e > "[nvptx] Add -mptx-comment" that causes a load of FAILs in nvptx > offloading testing: > > Program received signal SIGSEGV, Segmentation fault. > 0x000000000084abad in final_scan_insn_1 (insn=insn@entry=0x7ffff7380940, file=file@entry=0x1f50c40, optimize_p=optimize_p@entry=0, nopeepholes=nopeepholes@entry=0, seen=seen@entry=0x7fffffffd07c) at [...]/source-gcc/gcc/final.cc:2650 > 2650 if (*loc.file && loc.line) > (gdb) print loc > $1 = {file = 0x0, line = 0, column = 0, data = 0x0, sysp = false} > (gdb) bt > #0 0x000000000084abad in final_scan_insn_1 (insn=insn@entry=0x7ffff7380940, file=file@entry=0x1f50c40, optimize_p=optimize_p@entry=0, nopeepholes=nopeepholes@entry=0, seen=seen@entry=0x7fffffffd07c) at [...]/source-gcc/gcc/final.cc:2650 > #1 0x000000000084b86a in final_scan_insn (insn=insn@entry=0x7ffff7380940, file=file@entry=0x1f50c40, optimize_p=optimize_p@entry=0, nopeepholes=nopeepholes@entry=0, seen=seen@entry=0x7fffffffd07c) at [...]/source-gcc/gcc/final.cc:2942 > #2 0x000000000084823a in final_1 (first=0x7ffff74631c0, file=0x1f50c40, seen=1, optimize_p=0) at [...]/source-gcc/gcc/final.cc:1999 > #3 0x000000000085091a in rest_of_handle_final () at [...]/source-gcc/gcc/final.cc:4287 > #4 0x0000000000850de4 in (anonymous namespace)::pass_final::execute (this=0x1f4bd00) at [...]/source-gcc/gcc/final.cc:4365 > #5 0x0000000000b781b1 in execute_one_pass (pass=pass@entry=0x1f4bd00) at [...]/source-gcc/gcc/passes.cc:2639 > #6 0x0000000000b7855a in execute_pass_list_1 (pass=0x1f4bd00) at [...]/source-gcc/gcc/passes.cc:2739 > #7 0x0000000000b7858d in execute_pass_list_1 (pass=0x1f4b820) at [...]/source-gcc/gcc/passes.cc:2740 > #8 0x0000000000b7858d in execute_pass_list_1 (pass=0x1f49d20, pass@entry=0x1f45780) at [...]/source-gcc/gcc/passes.cc:2740 > #9 0x0000000000b785e9 in execute_pass_list (fn=0x7ffff72e1e40, pass=0x1f45780) at [...]/source-gcc/gcc/passes.cc:2750 > #10 0x0000000000732a66 in cgraph_node::expand (this=0x7ffff72efbb0) at [...]/source-gcc/gcc/cgraphunit.cc:1836 > #11 0x000000000073336a in cgraph_order_sort::process (this=0x20730f8) at [...]/source-gcc/gcc/cgraphunit.cc:2075 > #12 0x00000000007336f4 in output_in_order () at [...]/source-gcc/gcc/cgraphunit.cc:2143 > #13 0x0000000000733dbe in symbol_table::compile (this=0x7ffff7542000) at [...]/source-gcc/gcc/cgraphunit.cc:2347 > #14 0x000000000065d79b in lto_main () at [...]/source-gcc/gcc/lto/lto.cc:655 > #15 0x0000000000c709e6 in compile_file () at [...]/source-gcc/gcc/toplev.cc:454 > #16 0x0000000000c73abb in do_compile (no_backend=no_backend@entry=false) at [...]/source-gcc/gcc/toplev.cc:2160 > #17 0x0000000000c73ea6 in toplev::main (this=this@entry=0x7fffffffd4b0, argc=argc@entry=16, argv=0x1f1db40, argv@entry=0x7fffffffd5b8) at [...]/source-gcc/gcc/toplev.cc:2312 > #18 0x000000000174fe5f in main (argc=16, argv=0x7fffffffd5b8) at [...]/source-gcc/gcc/main.cc:41 > >> currently testing attached >> fix. > > Per the test results that I've got so far (but is still running), your > proposed fix does resolve the SIGSEGVs, thanks. Thanks for testing this, and sorry for the fall-out. Now committed. 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 <tdevries@suse.de> * 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.