https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109934
Fangrui Song <maskray at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |maskray at gcc dot gnu.org --- Comment #8 from Fangrui Song <maskray at gcc dot gnu.org> --- (In reply to GCC Commits from comment #6) > The releases/gcc-13 branch has been updated by Sam James > <sja...@gcc.gnu.org>: > > https://gcc.gnu.org/g:a987affa2b10cd8a0b1d244d9f010746837e031c > > commit r13-9114-ga987affa2b10cd8a0b1d244d9f010746837e031c > Author: Aldy Hernandez <al...@redhat.com> > Date: Tue May 23 12:34:45 2023 +0200 > > Remove buggy special case in irange::invert [PR109934]. > > This patch removes a buggy special case in irange::invert which seems > to have been broken for a while, and probably never triggered because > the legacy code was handled elsewhere, and the non-legacy code was > using an int_range_max of int_range<255> which made it extremely > likely for num_ranges == 255. However, with auto-resizing ranges, > int_range_max will start off at 3 and can hit this bogus code in the > unswitching code. > > PR tree-optimization/109934 > > gcc/ChangeLog: > > * value-range.cc (irange::invert): Remove buggy special case. > > gcc/testsuite/ChangeLog: > > * gcc.dg/tree-ssa/pr109934.c: New test. > > (cherry picked from commit 8d5f050dabbf6dd3b992c3b46661848dbcf30d9e) This commit in releases/gcc-13 but not in 13.3.0 has resolved a miscompile I've seen in LLVM llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp. Worked around in https://github.com/llvm/llvm-project/commit/6d67794d164ebeedbd287816e1541964fb5d6c99 Requires a -O3 build of llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp (CMAKE_BUILD_TYPE=Release; RelWithDebInfo uses -O2 and doesn't reproduce) ``` % ninja -C /tmp/out/custom-gcc-13 llc && /tmp/out/custom-gcc-13/bin/llc llvm/test/CodeGen/X86/2008-08-06-RewriterBug.ll -mtriple=i686 ninja: Entering directory `/tmp/out/custom-gcc-13' ninja: no work to do. Unknown immediate size UNREACHABLE executed at /home/ray/llvm/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h:904! ``` I am curious when the regression started to happen.