aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2020-10-26 17:50:37 +0100
committerAldy Hernandez <aldyh@redhat.com>2020-10-26 19:05:53 +0100
commit2118438f49f0c193abe3fa3def350a8129045746 (patch)
tree9a14a7334ad2760d8c7ccbdb4de9220544e1c068 /gcc/builtins.c
parentf20a6c57f0f26d9c60d6d6182f1e2181f727c834 (diff)
downloadgcc-2118438f49f0c193abe3fa3def350a8129045746.zip
gcc-2118438f49f0c193abe3fa3def350a8129045746.tar.gz
gcc-2118438f49f0c193abe3fa3def350a8129045746.tar.bz2
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.
Diffstat (limited to 'gcc/builtins.c')
0 files changed, 0 insertions, 0 deletions