Patchwork PATCH: PR lto/46760: LTO bootstrap doesn't work with FDO

login
register
mail settings
Submitter H.J. Lu
Date Jan. 10, 2011, 1:27 p.m.
Message ID <20110110132721.GA28794@intel.com>
Download mbox | patch
Permalink /patch/78147/
State New
Headers show

Comments

H.J. Lu - Jan. 10, 2011, 1:27 p.m.
Hi,

I checked in this patch to fix LTO bootstrap work with FDO on
Intel Core i7.  It is preaproved in

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46760#c23

H.J.
----

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 168630)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@ 
+2011-01-10  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR lto/46760
+	* tree-inline.c (tree_can_inline_p): Check e->call_stmt before
+	calling gimple_call_set_cannot_inline.
+
 2011-01-10  Iain Sandoe  <iains@gcc.gnu.org>
 
 	* config/darwin-sections.def: Remove unused section.
Index: tree-inline.c
===================================================================
--- tree-inline.c	(revision 168630)
+++ tree-inline.c	(working copy)
@@ -5380,7 +5380,8 @@  tree_can_inline_p (struct cgraph_edge *e
   if (inline_forbidden_into_p (caller, callee))
     {
       e->inline_failed = CIF_UNSPECIFIED;
-      gimple_call_set_cannot_inline (e->call_stmt, true);
+      if (e->call_stmt)
+	gimple_call_set_cannot_inline (e->call_stmt, true);
       return false;
     }
 
@@ -5388,7 +5389,8 @@  tree_can_inline_p (struct cgraph_edge *e
   if (!targetm.target_option.can_inline_p (caller, callee))
     {
       e->inline_failed = CIF_TARGET_OPTION_MISMATCH;
-      gimple_call_set_cannot_inline (e->call_stmt, true);
+      if (e->call_stmt)
+	gimple_call_set_cannot_inline (e->call_stmt, true);
       e->call_stmt_cannot_inline_p = true;
       return false;
     }
@@ -5405,7 +5407,8 @@  tree_can_inline_p (struct cgraph_edge *e
 	  || !gimple_check_call_args (e->call_stmt)))
     {
       e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
-      gimple_call_set_cannot_inline (e->call_stmt, true);
+      if (e->call_stmt)
+	gimple_call_set_cannot_inline (e->call_stmt, true);
       e->call_stmt_cannot_inline_p = true;
       return false;
     }