On Fri, Jan 31, 2025 at 01:38:36PM +0100, Richard Biener wrote: > > @@ -718,8 +720,11 @@ func_checker::compare_gimple_call (gcall > > > > /* For direct calls we verify that types are compatible so if we matched > > callees, callers must match, too. For indirect calls however verify > > - function type. */ > > - if (!gimple_call_fndecl (s1)) > > + function type. And also verify it for direct calls with some > > different > > + fntype. */ > > + if (!gimple_call_fndecl (s1) > > + || TREE_TYPE (TREE_TYPE (t1)) != fntype1 > > + || TREE_TYPE (TREE_TYPE (t2)) != fntype2) > > I think we want to always compare the ABI relevant fntypes. It seems > we can arrive here with internal function calls where t1/t2 are > "somthing" (NULL?). I guess doing this as else {} of the
For internal calls gimple_call_fndecl (s1) will be NULL, so !gimple_call_fndecl (s1) will be true and so the new checks aren't done. > if (gimple_call_internal_p (s1) (with gimple_call_internal_fn compare > in a conditiona if) would be a lot clearer? What the patch does is just trying to avoid the comparison in the common case (direct calls from the beginning and there what the comment says applies, if there would be a mismatch, we'd already knew that). If you want to compare unconditionally, it would be about just removing the if (!gimple_call_fndecl (s1)) { and } and reindenting + rewriting the comment above it. Shall I do that? Jakub