https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116189
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Andrew Pinski <pins...@gcc.gnu.org>: https://gcc.gnu.org/g:ba45573c8072f06f67af22a2ca60da5f5c12beae commit r14-10564-gba45573c8072f06f67af22a2ca60da5f5c12beae Author: Andrew Pinski <quic_apin...@quicinc.com> Date: Sat Aug 3 09:30:57 2024 -0700 sh: Don't call make_insn_raw in sh_recog_treg_set_expr [PR116189] This was an interesting compare debug failure to debug. The first symptom was in gcse which would produce different order of creating psedu-registers. This was caused by a different order of a hashtable walk, due to the hash table having different number of entries. Which in turn was due to the number of max insn being different between the 2 runs. The place max insn uid comes from was in sh_recog_treg_set_expr which is called via rtx_costs and fwprop would cause rtx_costs in some cases for debug insn related stuff. Build and tested for sh4-linux-gnu. PR target/116189 gcc/ChangeLog: * config/sh/sh.cc (sh_recog_treg_set_expr): Don't call make_insn_raw, make the insn with a fake uid. gcc/testsuite/ChangeLog: * c-c++-common/torture/pr116189-1.c: New test. Signed-off-by: Andrew Pinski <quic_apin...@quicinc.com> (cherry picked from commit 0355c943b9e954e8f59068971d934f1b91ecb729)