public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-7367] [nvptx] Fix dummy location in gen_comment
@ 2022-02-24  8:20 Tom de Vries
  0 siblings, 0 replies; only message in thread
From: Tom de Vries @ 2022-02-24  8:20 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7862f6ccd85a001e4d70abb00bb95d8c7846ba80

commit r12-7367-g7862f6ccd85a001e4d70abb00bb95d8c7846ba80
Author: Tom de Vries <tdevries@suse.de>
Date:   Wed Feb 23 09:33:33 2022 +0100

    [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.

Diff:
---
 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 858789e6df7..6f6d592e462 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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-24  8:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-24  8:20 [gcc r12-7367] [nvptx] Fix dummy location in gen_comment Tom de Vries

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).