diff mbox

[2/2] Set analyzed flag of unexpanded thunks in expand_thunk

Message ID 20140903084546.GB18073@virgil.suse
State New
Headers show

Commit Message

Martin Jambor Sept. 3, 2014, 8:45 a.m. UTC
Hi,

this is a followup to my previous PR-fixing patch.  At ever more
places we currently do

  if (!node->expand_thunk (false, whatever))
    node->analyzed = true;

and we always set the flag when expand_thunk returns with false (it
only can when the first parameter is false).  So I thought it would be
much nicer to set the analyzed flag in expand_thunk itself when it
returns false, especially given that we probably want to set the flag
at as few places as reasonably possible.

Bootstrapped and tested on x86_64-linux.  OK for trunk?

Thanks,

Martin


2014-09-01  Martin Jambor  <mjambor@suse.cz>

	* cgraphunit.c (expand_thunk): If not expanding, set analyzed flag.
	(analyze): Do not set analyze flag if expand_thunk returns false;.
	(create_wrapper): Likewise.
	* cgraphclones.c (duplicate_thunk_for_node): Likewise.
---
 gcc/cgraphclones.c |  4 +---
 gcc/cgraphunit.c   | 10 +++++-----
 2 files changed, 6 insertions(+), 8 deletions(-)

Comments

Jeff Law Sept. 3, 2014, 6:29 p.m. UTC | #1
On 09/03/14 02:45, Martin Jambor wrote:
> Hi,
>
> this is a followup to my previous PR-fixing patch.  At ever more
> places we currently do
>
>    if (!node->expand_thunk (false, whatever))
>      node->analyzed = true;
>
> and we always set the flag when expand_thunk returns with false (it
> only can when the first parameter is false).  So I thought it would be
> much nicer to set the analyzed flag in expand_thunk itself when it
> returns false, especially given that we probably want to set the flag
> at as few places as reasonably possible.
>
> Bootstrapped and tested on x86_64-linux.  OK for trunk?
>
> Thanks,
>
> Martin
>
>
> 2014-09-01  Martin Jambor  <mjambor@suse.cz>
>
> 	* cgraphunit.c (expand_thunk): If not expanding, set analyzed flag.
> 	(analyze): Do not set analyze flag if expand_thunk returns false;.
> 	(create_wrapper): Likewise.
> 	* cgraphclones.c (duplicate_thunk_for_node): Likewise.
OK.
Jeff
diff mbox

Patch

diff --git a/gcc/cgraphclones.c b/gcc/cgraphclones.c
index 2a17de5..224bb55 100644
--- a/gcc/cgraphclones.c
+++ b/gcc/cgraphclones.c
@@ -371,9 +371,7 @@  duplicate_thunk_for_node (cgraph_node *thunk, cgraph_node *node)
 						  CGRAPH_FREQ_BASE);
   e->call_stmt_cannot_inline_p = true;
   symtab->call_edge_duplication_hooks (thunk->callees, e);
-  if (!new_thunk->expand_thunk (false, false))
-    new_thunk->analyzed = true;
-  else
+  if (new_thunk->expand_thunk (false, false))
     {
       new_thunk->thunk.thunk_p = false;
       new_thunk->analyze ();
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 3a99729..3e3b8d2 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -576,7 +576,6 @@  cgraph_node::analyze (void)
       if (!expand_thunk (false, false))
 	{
 	  thunk.alias = NULL;
-	  analyzed = true;
 	  return;
 	}
       thunk.alias = NULL;
@@ -1451,7 +1450,10 @@  cgraph_node::expand_thunk (bool output_asm_thunks, bool force_gimple_thunk)
       tree restype = TREE_TYPE (TREE_TYPE (thunk_fndecl));
 
       if (!output_asm_thunks)
-	return false;
+	{
+	  analyzed = true;
+	  return false;
+	}
 
       if (in_lto_p)
 	get_body ();
@@ -2313,9 +2315,7 @@  cgraph_node::create_wrapper (cgraph_node *target)
 
     cgraph_edge *e = create_edge (target, NULL, 0, CGRAPH_FREQ_BASE);
 
-    if (!expand_thunk (false, true))
-      analyzed = true;
-
+    expand_thunk (false, true);
     e->call_stmt_cannot_inline_p = true;
 
     /* Inline summary set-up.  */