public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR91231
@ 2019-07-23 10:15 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2019-07-23 10:15 UTC (permalink / raw)
  To: gcc-patches


With LTO it's easy to run out of linemap encoding space (surprisingly
so for columns even though LTO never uses any column besides zero...).
But some code cannot deal with locations being dropped to zero
"after the fact" (without LTO you do not get re-encoding), in this
example it is the inline-entry markers which assert that the
corresponding BLOCK has a location associated with an inline.

The fix here is to drop those stmts when we end up re-encoding
a formerly inlined_function_outer_scope_p as UNKNOWN_LOCATION.

Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.

Richard.

2019-07-23  Richard Biener  <rguenther@suse.de>

	PR debug/91231
	* lto-streamer-in.c (input_function): Drop inline-entry markers
	that ended up with an unknown location block.

Index: gcc/lto-streamer-in.c
===================================================================
--- gcc/lto-streamer-in.c	(revision 273718)
+++ gcc/lto-streamer-in.c	(working copy)
@@ -1140,6 +1140,14 @@ input_function (tree fn_decl, struct dat
 		      ? !MAY_HAVE_DEBUG_MARKER_STMTS
 		      : !MAY_HAVE_DEBUG_BIND_STMTS))
 		remove = true;
+	      /* In case the linemap overflows locations can be dropped
+		 to zero.  Thus do not keep nonsensical inline entry markers
+		 we'd later ICE on.  */
+	      tree block;
+	      if (gimple_debug_inline_entry_p (stmt)
+		  && (block = gimple_block (stmt))
+		  && !inlined_function_outer_scope_p (block))
+		remove = true;
 	      if (is_gimple_call (stmt)
 		  && gimple_call_internal_p (stmt))
 		{

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

only message in thread, other threads:[~2019-07-23 10:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-23 10:15 [PATCH] Fix PR91231 Richard Biener

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