https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105150
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:973a2ce71f8dab559fbbfc34b59e39e047df74a6 commit r12-8041-g973a2ce71f8dab559fbbfc34b59e39e047df74a6 Author: Jakub Jelinek <ja...@redhat.com> Date: Thu Apr 7 09:10:58 2022 +0200 tree.cc: Add tree_builtin_call_types_compatible_p [PR105150] And here is the follow-up patch that does the argument checking on GENERIC. It ensures TYPE_MAIN_VARIANT == TYPE_MAIN_VARIANT compatibility on the arguments, except for pointer arguments where both builtin's prototype and actual arguments have to be pointers and satisfy tree_nop_conversion_p, and for promoted char/short arguments where argument need to have integral signed type tree_nop_conversion_p compatible with integer_type_node. 2022-04-07 Jakub Jelinek <ja...@redhat.com> PR tree-optimization/105150 * tree.cc (tree_builtin_call_types_compatible_p): New function. (get_call_combined_fn): Use it. * gcc.dg/pr105150.c: New test.