Fix range type signed-ness heuristic
authorTom Tromey <tromey@adacore.com>
Thu, 20 Oct 2022 13:08:48 +0000 (07:08 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 28 Nov 2022 14:26:07 +0000 (07:26 -0700)
commit912b12ad84adf32af5827511af5afecedb108c63
tree75c86277589247b19782e24bcf6b04ff31667631
parented14d866a31625c6f8c2cb6d4a445a8372b46161
Fix range type signed-ness heuristic

The code to create a range type has a heuristic to decide whether the
range is unsigned.  However, this heuristic can fail if the upper
bound of the range has its high bit set, because the test is done
using LONGEST.

With this patch, if the underlying type of a range is unsigned, then
the range will always be unsigned.  A new test is included.

Regression tested on x86-64 Fedora 34.  We've also been using this
internally at AdaCore for a while.
gdb/gdbtypes.c
gdb/testsuite/gdb.ada/unsigned_last.exp [new file with mode: 0644]
gdb/testsuite/gdb.ada/unsigned_last/main.adb [new file with mode: 0644]