https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106981
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> --- (In reply to Jakub Jelinek from comment #5) > The fix could be either partially backport what C++ FE did in > --- gcc/c/c-typeck.cc.jj 2022-09-23 09:02:56.525318361 +0200 > +++ gcc/c/c-typeck.cc 2022-09-23 10:33:06.596467788 +0200 > + if (CONSTANT_CLASS_P (t1) && !comptypes (TREE_TYPE (t1), TREE_TYPE (t2))) > + return false; Maybe. Though I think we still need something like my: + if (n > TREE_OPERAND_LENGTH (t2)) + return false; (With ">" not ">=" as I accidentally had.) Given that if (!c_tree_equal (TREE_OPERAND (t1, i), TREE_OPERAND (t2, i))) does not make sense when exceeding the operand length! Nonetheless, ... > Now, wonder what will break if I just strip same type casts and > for others like in C++ require same type. sounds like a reasonable approach,.