https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77826
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) > --- gcc/genmatch.c (revision 240739) > +++ gcc/genmatch.c (working copy) > @@ -2593,8 +2601,10 @@ dt_operand::gen_match_op (FILE *f, int i > { > char match_opname[20]; > match_dop->get_name (match_opname); > - fprintf_indent (f, indent, "if (%s == %s || operand_equal_p (%s, %s, > 0))\n", > - opname, match_opname, opname, match_opname); > + fprintf_indent (f, indent, "if (%s == %s || (operand_equal_p (%s, %s, 0) " > + "&& types_match (%s, %s)))\n", > + opname, match_opname, opname, match_opname, > + opname, match_opname); > fprintf_indent (f, indent + 2, "{\n"); > return 1; > } But that will mean the pattern will no longer match. While it is generally safer, for the cases like this simplify, shall it then use (convert? @2) instead and add operand_equal_p for @0 and @2? I guess all it cares is that @0 actually has the same type as @1 there, not a different one?