diff mbox

Avoid inlining into instrumetnation thunks

Message ID 20160516193414.GB64812@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka May 16, 2016, 7:34 p.m. UTC
Hi,
this patch fixes chkp ICE when we try to inline into an instrumentation thunk.
This is not really a thunk and ths can't be hanled as such.

Bootstrapped/regtested x86_64-linux

Honza

2016-05-16  Jan Hubicka  <hubicka@ucw.cz>

	* ipa-inline-analysis.c (compute_inline_parameters): Disable inlinig
	into instrumentation thunks.
	* cif-code.def (CIF_CHKP): New.

Comments

Richard Biener May 17, 2016, 11:21 a.m. UTC | #1
On Mon, May 16, 2016 at 9:34 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
> Hi,
> this patch fixes chkp ICE when we try to inline into an instrumentation thunk.
> This is not really a thunk and ths can't be hanled as such.
>
> Bootstrapped/regtested x86_64-linux
>
> Honza
>
> 2016-05-16  Jan Hubicka  <hubicka@ucw.cz>
>
>         * ipa-inline-analysis.c (compute_inline_parameters): Disable inlinig
>         into instrumentation thunks.
>         * cif-code.def (CIF_CHKP): New.
>
> Index: ipa-inline-analysis.c
> ===================================================================
> --- ipa-inline-analysis.c       (revision 236275)
> +++ ipa-inline-analysis.c       (working copy)
> @@ -2943,7 +2943,13 @@ compute_inline_parameters (struct cgraph
>        info->self_size = info->size;
>        info->self_time = info->time;
>        /* We can not inline instrumetnation clones.  */
> -      info->inlinable = !node->thunk.add_pointer_bounds_args;
> +      if (node->thunk.add_pointer_bounds_args)
> +       {
> +          info->inlinable = false;
> +          node->callees->inline_failed = CIF_CHKP;
> +       }
> +      else
> +        info->inlinable = true;
>      }
>    else
>      {
> Index: cif-code.def
> ===================================================================
> --- cif-code.def        (revision 236275)
> +++ cif-code.def        (working copy)
> @@ -135,3 +135,7 @@ DEFCIFCODE(CILK_SPAWN, CIF_FINAL_ERROR,
>  /* We proved that the call is unreachable.  */
>  DEFCIFCODE(UNREACHABLE, CIF_FINAL_ERROR,
>            N_("unreachable"))
> +
> +/* We can't inline because of instrumentation thunk.  */
> +DEFCIFCODE(CHKP, CIF_FINAL_ERROR,
> +          N_("caller is instrumetnation thunk"))

instrumentation
diff mbox

Patch

Index: ipa-inline-analysis.c
===================================================================
--- ipa-inline-analysis.c	(revision 236275)
+++ ipa-inline-analysis.c	(working copy)
@@ -2943,7 +2943,13 @@  compute_inline_parameters (struct cgraph
       info->self_size = info->size;
       info->self_time = info->time;
       /* We can not inline instrumetnation clones.  */
-      info->inlinable = !node->thunk.add_pointer_bounds_args;
+      if (node->thunk.add_pointer_bounds_args)
+	{
+          info->inlinable = false;
+          node->callees->inline_failed = CIF_CHKP;
+	}
+      else
+        info->inlinable = true;
     }
   else
     {
Index: cif-code.def
===================================================================
--- cif-code.def	(revision 236275)
+++ cif-code.def	(working copy)
@@ -135,3 +135,7 @@  DEFCIFCODE(CILK_SPAWN, CIF_FINAL_ERROR,
 /* We proved that the call is unreachable.  */
 DEFCIFCODE(UNREACHABLE, CIF_FINAL_ERROR,
 	   N_("unreachable"))
+
+/* We can't inline because of instrumentation thunk.  */
+DEFCIFCODE(CHKP, CIF_FINAL_ERROR,
+	   N_("caller is instrumetnation thunk"))