diff mbox series

Fix PR middle-end/87916

Message ID 1719808.xBNmrKsvZy@polaris
State New
Headers show
Series Fix PR middle-end/87916 | expand

Commit Message

Eric Botcazou Nov. 8, 2018, 2:58 p.m. UTC
Since expand_thunk no longer overrides the DECL_IGNORED_P setting on the thunk 
from the front-end in every case, duplicate_thunk_for_node may create a new 
thunk without DECL_IGNORED_P set and this doesn't play with inlining and early 
debug info generation; fixed by forcing DECL_IGNORED_P as before in this case.

Bootstrapped/regtested on x86-64/Linux, applied on the mainline as obvious.


2018-11-08  Eric Botcazou  <ebotcazou@adacore.com>

	PR middle-end/87916
	* cgraphclones.c (duplicate_thunk_for_node): Also set DECL_IGNORED_P.


2018-11-08  Eric Botcazou  <ebotcazou@adacore.com>

	* g++.dg/other/pr87916.C: New test.
diff mbox series

Patch

Index: cgraphclones.c
===================================================================
--- cgraphclones.c	(revision 265866)
+++ cgraphclones.c	(working copy)
@@ -321,6 +321,10 @@  duplicate_thunk_for_node (cgraph_node *t
 						       "artificial_thunk");
   SET_DECL_ASSEMBLER_NAME (new_decl, DECL_NAME (new_decl));
 
+  /* We need to force DECL_IGNORED_P because the new thunk is created after
+     early debug was run.  */
+  DECL_IGNORED_P (new_decl) = 1;
+
   new_thunk = cgraph_node::create (new_decl);
   set_new_clone_decl_and_node_flags (new_thunk);
   new_thunk->definition = true;