On 5/25/2021 12:44 AM, Aldy Hernandez wrote:
avr-elf seems to use HImode for both integer_type_node and
signed_char_type_node, which is causing the check for different sized
VARYING ranges to fail.
I've fixed this by using a char which I think should always be smaller than an
int. Is there a preferred way of fixing this? Perhaps
build_nonstandard_integer
or __attribute__((mode(XX)))?
Tested on an x86-64 x avr-elf.
gcc/ChangeLog:
* value-range.cc (range_tests_legacy): Use signed char instead
of signed short.
As you note, I wonder if we should just creating our own types for this
test. In fact I wonder if that should be considered best practice for
these tests. Assumptions about the underlying sizes of the standard
types has been slightly problematical for the range self-tests.
The alternate approach would be to check the underlying sizes/signedness
and skip the tests when they don't give us what we need. But that seems
inferior to just creating a suitable type.
Jeff
ps. xstormy16-elf seems to be failing in the same way. I'll assume
it's the same problem ;-)