Handle signed 1-bit ranges in irange::invert.
The problem here is we are trying to add 1 to a -1 in a signed 1-bit
field and coming up with UNDEFINED because of the overflow.
Signed 1-bits are annoying because you can't really add or subtract
one, because the one is unrepresentable. For invert() we have a
special subtract_one() function that handles 1-bit signed fields.
This patch implements the analogous add_one() function so that invert
works.
gcc/ChangeLog:
PR tree-optimization/97555
* range-op.cc (range_tests): Test 1-bit signed invert.
* value-range.cc (subtract_one): Adjust comment.
(add_one): New.
(irange::invert): Call add_one.
gcc/testsuite/ChangeLog:
* gcc.dg/pr97555.c: New test.