Check e->call_stmt before calling gimple_call_set_cannot_inline.
authorH.J. Lu <hongjiu.lu@intel.com>
Mon, 10 Jan 2011 13:24:27 +0000 (13:24 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 10 Jan 2011 13:24:27 +0000 (05:24 -0800)
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.

From-SVN: r168631

gcc/ChangeLog
gcc/tree-inline.c

index 12b7efc5466ad931ad3247ff860267a30dd94252..a07601f8dd829c0858449a2fcdfd5e30e4cb810d 100644 (file)
@@ -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 8725ca41953191e7a94806074008f946f798c2e7..6c76fe3b9947e991bfa5b0550de79d5a08818985 100644 (file)
@@ -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;
     }