On Wed, Apr 06, 2022 at 09:49:25AM +0200, Richard Biener wrote: > On trees we'd use tree_[sign_]nop_conversion () instead of > useless_type_conversion_p, I think it's OK to allow all such > pointer conversions. In the end this probably means being > more forgiving than TYPE_MAIN_VARIANT equivalence throughout, that > would also make the code more similar to > gimple_builtin_call_types_compatible_p besides > s/useless_type_conversion_p/tree_sign_nop_conversion/ > > What do you think? If we don't go for strict TYPE_MAIN_VARIANT > compatibility we should apply lax rules for all, the return > type and all argument types. It's not that the GENERIC we end > up building from GIMPLE in various places adheres to the strict > GENERIC type compatibility rules ...
Dunno, we don't really have a verifier for GENERIC. Don't we even require that the types are actually same rather than similar for say binary ops other than shifts, or for comparisons, or result and first argument for unary and binary etc.? I think at least for the most common cases the C/C++ FEs ensure that through choosing some common type for the operation and folding the arguments to that type. Though I bet we violate it pretty often with e.g. sizetype vs. size_type_node differences etc. Jakub