return gimple_call_arg (m_call, idx);
}
+/* Get the type of argument IDX. */
+
+tree
+call_details::get_arg_type (unsigned idx) const
+{
+ return TREE_TYPE (gimple_call_arg (m_call, idx));
+}
+
/* Get argument IDX at the callsite as an svalue. */
const svalue *
/* No side-effects (tracking stream state is out-of-scope
for the analyzer). */
}
- else if (is_named_call_p (callee_fndecl, "memset", call, 3))
+ else if (is_named_call_p (callee_fndecl, "memset", call, 3)
+ && POINTER_TYPE_P (cd.get_arg_type (0)))
{
impl_call_memset (cd);
return false;
}
- else if (is_named_call_p (callee_fndecl, "strlen", call, 1))
+ else if (is_named_call_p (callee_fndecl, "strlen", call, 1)
+ && POINTER_TYPE_P (cd.get_arg_type (0)))
{
if (impl_call_strlen (cd))
return false;
bool maybe_set_lhs (const svalue *result) const;
tree get_arg_tree (unsigned idx) const;
+ tree get_arg_type (unsigned idx) const;
const svalue *get_arg_svalue (unsigned idx) const;
void dump_to_pp (pretty_printer *pp, bool simple) const;
--- /dev/null
+/* { dg-additional-options "-Wno-builtin-declaration-mismatch" } */
+
+void *
+memset (int, int, __SIZE_TYPE__);
+
+void
+mp (int xl)
+{
+ memset (xl, 0, sizeof xl);
+}