diff options
Diffstat (limited to 'gcc/vr-values.c')
-rw-r--r-- | gcc/vr-values.c | 32 |
1 files changed, 3 insertions, 29 deletions
diff --git a/gcc/vr-values.c b/gcc/vr-values.c index 32f64e0..bba170f 100644 --- a/gcc/vr-values.c +++ b/gcc/vr-values.c @@ -313,35 +313,9 @@ gimple_stmt_nonzero_p (gimple *stmt) return gimple_assign_nonzero_p (stmt); case GIMPLE_CALL: { - tree fndecl = gimple_call_fndecl (stmt); - if (!fndecl) return false; - if (flag_delete_null_pointer_checks && !flag_check_new - && DECL_IS_OPERATOR_NEW (fndecl) - && !TREE_NOTHROW (fndecl)) - return true; - /* References are always non-NULL. */ - if (flag_delete_null_pointer_checks - && TREE_CODE (TREE_TYPE (fndecl)) == REFERENCE_TYPE) - return true; - if (flag_delete_null_pointer_checks && - lookup_attribute ("returns_nonnull", - TYPE_ATTRIBUTES (gimple_call_fntype (stmt)))) - return true; - - gcall *call_stmt = as_a<gcall *> (stmt); - unsigned rf = gimple_call_return_flags (call_stmt); - if (rf & ERF_RETURNS_ARG) - { - unsigned argnum = rf & ERF_RETURN_ARG_MASK; - if (argnum < gimple_call_num_args (call_stmt)) - { - tree arg = gimple_call_arg (call_stmt, argnum); - if (SSA_VAR_P (arg) - && infer_nonnull_range_by_attribute (stmt, arg)) - return true; - } - } - return gimple_alloca_call_p (stmt); + gcall *call_stmt = as_a<gcall *> (stmt); + return (gimple_call_nonnull_result_p (call_stmt) + || gimple_call_nonnull_arg (call_stmt)); } default: gcc_unreachable (); |