public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 2/2] Ada: Remove debug line number for DECL_IGNORED_P functions
@ 2021-07-26 16:45 Bernd Edlinger
  2021-08-02 13:07 ` Eric Botcazou
  0 siblings, 1 reply; 11+ messages in thread
From: Bernd Edlinger @ 2021-07-26 16:45 UTC (permalink / raw)
  To: gcc-patches, Richard Biener, Eric Botcazou, Arnaud Charlet

It was pointed out in PR101598 to be inappropriate, that
ignored Ada decls receive the source line number which was
recorded in the function decl's DECL_SOURCE_LOCATION.
Therefore set all front-end-generated Ada decls with
DECL_IGNORED_P to UNKNOWN_LOCATION.

2021-07-24  Bernd Edlinger  <bernd.edlinger@hotmail.de>

	PR debug/101598
	* gcc-interface/trans.c (Subprogram_Body_to_gnu): Set the
	DECL_SOURCE_LOCATION of DECL_IGNORED_P gnu_subprog_decl to
	UNKNOWN_LOCATION.
---
 gcc/ada/gcc-interface/trans.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index f61183d..3df56aa 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -3885,7 +3885,9 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
     }
 
   /* Set the line number in the decl to correspond to that of the body.  */
-  if (!Sloc_to_locus (Sloc (gnat_node), &locus, false, gnu_subprog_decl))
+  if (DECL_IGNORED_P (gnu_subprog_decl))
+    locus = UNKNOWN_LOCATION;
+  else if (!Sloc_to_locus (Sloc (gnat_node), &locus, false, gnu_subprog_decl))
     locus = input_location;
   DECL_SOURCE_LOCATION (gnu_subprog_decl) = locus;
 
-- 
1.9.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-08-11  5:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-26 16:45 [PATCH 2/2] Ada: Remove debug line number for DECL_IGNORED_P functions Bernd Edlinger
2021-08-02 13:07 ` Eric Botcazou
2021-08-02 17:18   ` Bernd Edlinger
2021-08-04 14:33     ` Eric Botcazou
2021-08-04 17:59       ` Bernd Edlinger
2021-08-09 14:37         ` Eric Botcazou
2021-08-10  7:23           ` Richard Biener
2021-08-10 15:46             ` Eric Botcazou
2021-08-10  9:43           ` Bernd Edlinger
2021-08-10 20:56             ` Eric Botcazou
2021-08-11  5:27               ` Bernd Edlinger

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