https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101938
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Aldy Hernandez <al...@gcc.gnu.org>: https://gcc.gnu.org/g:891bdbf2b0432b4aa3d3e76923617fcb4fd33cf6 commit r12-2944-g891bdbf2b0432b4aa3d3e76923617fcb4fd33cf6 Author: Andrew MacLeod <amacl...@redhat.com> Date: Tue Aug 17 10:50:56 2021 +0200 Special case -TYPE_MIN_VALUE for flag_wrapv in operator_abs::op1_range. With flag_wrapv, -TYPE_MIN_VALUE = TYPE_MIN_VALUE which is unrepresentable. We currently special case this in the ABS folding routine, but are missing similar treatment in operator_abs::op1_range. Tested on x86-64 Linux. PR tree-optimization/101938 gcc/ChangeLog: * range-op.cc (operator_abs::op1_range): Special case -TYPE_MIN_VALUE for flag_wrapv. gcc/testsuite/ChangeLog: * gcc.dg/pr101938.c: New test.