+ if (get_method_variadicity(get_entity_type(ent)) == variadicity_variadic) {
+ /* Arg, KR functions are marked as variadic one's, so check further */
+ ir_type *mtp = get_entity_type(ent);
+ ir_type *ctp = get_Call_type(call);
+ int n_params = get_method_n_params(mtp);
+ int i;
+
+ /* This is too strong, but probably ok. Function calls with a wrong number of
+ parameters should not be inlined. */
+ if (n_params != get_method_n_params(ctp))
+ return 0;
+
+ /* check types: for K&R calls, this was not done by the compiler. Again, this is
+ too strong, but ok for now. */
+ for (i = n_params - 1; i >= 0; --i) {
+ ir_type *param_tp = get_method_param_type(mtp, i);
+ ir_type *arg_tp = get_method_param_type(ctp, i);
+
+ if (param_tp != arg_tp)
+ return 0;
+ }
+ DB((dbg, LEVEL_1, "Inlining allowed for variadic function %+F\n", called_graph));
+ /* types match, fine: when the frame is access, the inliner stops at can_inline() */
+ }