re PR target/48807 (Segfault building newlib for bfin)
authorStuart Henderson <shenders@gcc.gnu.org>
Thu, 2 Jun 2011 16:16:52 +0000 (16:16 +0000)
committerStuart Henderson <shenders@gcc.gnu.org>
Thu, 2 Jun 2011 16:16:52 +0000 (16:16 +0000)
2011-06-02  Stuart Henderson  <shenders@gcc.gnu.org>

    PR target/48807
    * config/bfin/bfin.c (bfin_function_ok_for_sibcall): Check return value
    of cgraph_local_info for null before attempting to use it.

From-SVN: r174567

gcc/ChangeLog
gcc/config/bfin/bfin.c

index c44ba410c88e447ca99c06848c12ac3216cfdcec..5bd12d2b8d08d1ca719d0d48907338621f549e7c 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-02  Stuart Henderson  <shenders@gcc.gnu.org>
+
+       PR target/48807
+       * config/bfin/bfin.c (bfin_function_ok_for_sibcall): Check return value
+       of cgraph_local_info for null before attempting to use it.
+
 2011-06-02  Eric Botcazou  <ebotcazou@adacore.com>
 
        * function.h (struct stack_usage): Remove dynamic_alloc_count field.
index 4f371fd928f5b8000add873ee97ed4eb6fedaa4c..0b860c510b64162772ef58edd5c6f3656940c5b1 100644 (file)
@@ -2110,6 +2110,8 @@ bfin_function_ok_for_sibcall (tree decl ATTRIBUTE_UNUSED,
  
   this_func = cgraph_local_info (current_function_decl);
   called_func = cgraph_local_info (decl);
+  if (!called_func)
+    return false;
   return !called_func->local || this_func->local;
 }
 \f