diff mbox series

Fix PR91231

Message ID alpine.LSU.2.20.1907231206580.30921@zhemvz.fhfr.qr
State New
Headers show
Series Fix PR91231 | expand

Commit Message

Richard Biener July 23, 2019, 10:09 a.m. UTC
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.
diff mbox series

Patch

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