[Bug tree-optimization/122943] [14/15/16 Regression] Wrong code for switch on int64_t on ilp32 targets at -O2 since r14-8302

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 2 12:26:45 GMT 2025


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.


More information about the Gcc-bugs mailing list