+/* Verify if the type of the argument matches that of the function
+ declaration. If we cannot verify this or there is a mismatch,
+ return false. */
+
+bool
+gimple_check_call_args (gimple stmt)
+{
+ tree fndecl, parms, p;
+ unsigned int i, nargs;
+
+ nargs = gimple_call_num_args (stmt);
+
+ /* Get argument types for verification. */
+ fndecl = gimple_call_fndecl (stmt);
+ parms = NULL_TREE;
+ if (fndecl)
+ parms = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
+ else if (POINTER_TYPE_P (TREE_TYPE (gimple_call_fn (stmt))))
+ parms = TYPE_ARG_TYPES (TREE_TYPE (TREE_TYPE (gimple_call_fn (stmt))));
+
+ /* Verify if the type of the argument matches that of the function
+ declaration. If we cannot verify this or there is a mismatch,
+ return false. */
+ if (fndecl && DECL_ARGUMENTS (fndecl))
+ {
+ for (i = 0, p = DECL_ARGUMENTS (fndecl);
+ i < nargs;
+ i++, p = DECL_CHAIN (p))
+ {
+ /* We cannot distinguish a varargs function from the case
+ of excess parameters, still deferring the inlining decision
+ to the callee is possible. */
+ if (!p)
+ break;
+ if (p == error_mark_node
+ || gimple_call_arg (stmt, i) == error_mark_node
+ || !fold_convertible_p (DECL_ARG_TYPE (p),
+ gimple_call_arg (stmt, i)))
+ return false;
+ }
+ }
+ else if (parms)
+ {
+ for (i = 0, p = parms; i < nargs; i++, p = TREE_CHAIN (p))
+ {
+ /* If this is a varargs function defer inlining decision
+ to callee. */
+ if (!p)
+ break;
+ if (TREE_VALUE (p) == error_mark_node
+ || gimple_call_arg (stmt, i) == error_mark_node
+ || TREE_CODE (TREE_VALUE (p)) == VOID_TYPE
+ || !fold_convertible_p (TREE_VALUE (p),
+ gimple_call_arg (stmt, i)))
+ return false;
+ }
+ }
+ else
+ {
+ if (nargs != 0)
+ return false;
+ }
+ return true;
+}
+
+
+/* Lower sequence SEQ. Unlike gimplification the statements are not relowered