On Thu, Nov 17, 2016 at 12:19:37AM +0530, Prathamesh Kulkarni wrote:
> --- a/gcc/tree-vrp.c
> +++ b/gcc/tree-vrp.c
> @@ -1069,6 +1069,34 @@ gimple_assign_nonzero_warnv_p (gimple *stmt, bool
> *strict_overflow_p)
> }
> }
>
> +/* Return true if STMT is known to contain call to a string-builtin function
> + that is known to return nonnull. */
> +
> +static bool
> +gimple_str_nonzero_warnv_p (gimple *stmt)
> +{
> + if (!is_gimple_call (stmt))
> + return false;
Shouldn't this be:
if (!gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
return false;
> +
> + tree fndecl = gimple_call_fndecl (stmt);
> + if (!fndecl || DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
> + return false;
And drop the above 2 lines?
That we you also verify the arguments for sanity.
Otherwise I'll defer to Richard.
Jakub