https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115876
--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jeff Law <l...@gcc.gnu.org>: https://gcc.gnu.org/g:94b21f13763638f64e83e7f9959c7f1523b9eaed commit r15-2048-g94b21f13763638f64e83e7f9959c7f1523b9eaed Author: Jeff Law <j...@ventanamicro.com> Date: Mon Jul 15 16:57:44 2024 -0600 Fix sign/carry bit handling in ext-dce. My change to fix a ubsan issue broke handling propagation of the carry/sign bit down through a right shift. Thanks to Andreas for the analysis and proposed fix and Sergei for the testcase. PR rtl-optimization/115876 PR rtl-optimization/115916 gcc/ * ext-dce.cc (carry_backpropagate): Make return type unsigned as well. Cast to signed for right shift to preserve sign bit. gcc/testsuite/ * g++.dg/torture/pr115916.C: New test. Co-author: Andreas Schwab <sch...@linux-m68k.org> Co-author: Sergei Trofimovich <slyfox at gentoo dot org>