https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122943
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 62970 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62970&action=edit gcc16-pr122943.patch Untested fix. gen_inbound_check uses m_arr_ref_first's lhs to find the unsigned type and value to compare against highest bound, so m_arr_ref_first should always compute utype and the optional cast to sizetype should happen only after that.
