]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/tree-ssa-ccp.c
Protect some checks of DECL_FUNCTION_CODE
[thirdparty/gcc.git] / gcc / tree-ssa-ccp.c
index f25e6c8c9a99aa13f68a3fd32b0f99dfa5bdc4d1..458b2184d3f4191b5fa0a925d6c639b4b1b7479c 100644 (file)
@@ -2598,7 +2598,7 @@ optimize_stack_restore (gimple_stmt_iterator i)
          || ALLOCA_FUNCTION_CODE_P (DECL_FUNCTION_CODE (callee)))
        return NULL_TREE;
 
-      if (DECL_FUNCTION_CODE (callee) == BUILT_IN_STACK_RESTORE)
+      if (fndecl_built_in_p (callee, BUILT_IN_STACK_RESTORE))
        goto second_stack_restore;
     }
 
@@ -2657,9 +2657,6 @@ optimize_stdarg_builtin (gimple *call)
   bool va_list_simple_ptr;
   location_t loc = gimple_location (call);
 
-  if (gimple_code (call) != GIMPLE_CALL)
-    return NULL_TREE;
-
   callee = gimple_call_fndecl (call);
 
   cfun_va_list = targetm.fn_abi_va_list (callee);