https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111445
--- Comment #10 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-12 branch has been updated by Richard Biener <rgue...@gcc.gnu.org>: https://gcc.gnu.org/g:948c4616e504b656278cd47f8b96ad3fb47db626 commit r12-10011-g948c4616e504b656278cd47f8b96ad3fb47db626 Author: Richard Biener <rguent...@suse.de> Date: Fri Oct 20 15:08:49 2023 +0200 tree-optimization/111445 - simple_iv simplification fault The following fixes a missed check in the simple_iv attempt to simplify (signed T)((unsigned T) base + step) where it allows a truncating inner conversion leading to wrong code. PR tree-optimization/111445 * tree-scalar-evolution.cc (simple_iv_with_niters): Add missing check for a sign-conversion. * gcc.dg/torture/pr111445.c: New testcase. (cherry picked from commit 9692309ed6b625f0fb358c0e230404b5603f69a6)