Patchwork [v3] IPA: fixing inline fail report caused by overwritable functions.

login
register
mail settings
Submitter Zhouyi Zhou
Date April 8, 2013, 2:47 a.m.
Message ID <1365389232-25991-1-git-send-email-yizhouzhou@ict.ac.cn>
Download mbox | patch
Permalink /patch/234559/
State New
Headers show

Comments

Zhouyi Zhou - April 8, 2013, 2:47 a.m.
When inline failed because of callee is overwritable, gcc will not report it
in dump file (triggered by -fdump-tree-einline) as other not inlinable cases 
do. This patch correct this.

Regtested/bootstrapped on x86_64-linux.

ChangeLog:
2013-04-08 Zhouyi Zhou <yizhouzhou@ict.ac.cn>
	   * cif-code.def (OVERWRITABLE): correct the comment for overwritable 
	    function
	   * ipa-inline.c (can_inline_edge_p): let dump mechanism report the inline
	   fail caused by overwritable functions.
Richard Guenther - April 8, 2013, 9:48 a.m.
On Mon, Apr 8, 2013 at 4:47 AM, Zhouyi Zhou <zhouzhouyi@gmail.com> wrote:
> When inline failed because of callee is overwritable, gcc will not report it
> in dump file (triggered by -fdump-tree-einline) as other not inlinable cases
> do. This patch correct this.
>
> Regtested/bootstrapped on x86_64-linux.

Can you trigger this message to show up with -Winline before/after the patch?
Can you please add a testcase then?

Thanks,
Richard.

> ChangeLog:
> 2013-04-08 Zhouyi Zhou <yizhouzhou@ict.ac.cn>
>            * cif-code.def (OVERWRITABLE): correct the comment for overwritable
>             function
>            * ipa-inline.c (can_inline_edge_p): let dump mechanism report the inline
>            fail caused by overwritable functions.
>
> Index: gcc/ipa-inline.c
> ===================================================================
> --- gcc/ipa-inline.c    (revision 197549)
> +++ gcc/ipa-inline.c    (working copy)
> @@ -266,7 +266,7 @@ can_inline_edge_p (struct cgraph_edge *e
>    else if (avail <= AVAIL_OVERWRITABLE)
>      {
>        e->inline_failed = CIF_OVERWRITABLE;
> -      return false;
> +      inlinable = false;
>      }
>    else if (e->call_stmt_cannot_inline_p)
>      {
> Index: gcc/cif-code.def
> ===================================================================
> --- gcc/cif-code.def    (revision 197549)
> +++ gcc/cif-code.def    (working copy)
> @@ -48,7 +48,7 @@ DEFCIFCODE(REDEFINED_EXTERN_INLINE,
>  /* Function is not inlinable.  */
>  DEFCIFCODE(FUNCTION_NOT_INLINABLE, N_("function not inlinable"))
>
> -/* Function is not overwritable.  */
> +/* Function is overwritable.  */
>  DEFCIFCODE(OVERWRITABLE, N_("function body can be overwritten at link time"))
>
>  /* Function is not an inlining candidate.  */

Patch

Index: gcc/ipa-inline.c
===================================================================
--- gcc/ipa-inline.c	(revision 197549)
+++ gcc/ipa-inline.c	(working copy)
@@ -266,7 +266,7 @@  can_inline_edge_p (struct cgraph_edge *e
   else if (avail <= AVAIL_OVERWRITABLE)
     {
       e->inline_failed = CIF_OVERWRITABLE;
-      return false;
+      inlinable = false;
     }
   else if (e->call_stmt_cannot_inline_p)
     {
Index: gcc/cif-code.def
===================================================================
--- gcc/cif-code.def	(revision 197549)
+++ gcc/cif-code.def	(working copy)
@@ -48,7 +48,7 @@  DEFCIFCODE(REDEFINED_EXTERN_INLINE,
 /* Function is not inlinable.  */
 DEFCIFCODE(FUNCTION_NOT_INLINABLE, N_("function not inlinable"))
 
-/* Function is not overwritable.  */
+/* Function is overwritable.  */
 DEFCIFCODE(OVERWRITABLE, N_("function body can be overwritten at link time"))
 
 /* Function is not an inlining candidate.  */