From: Aldy Hernandez Date: Tue, 25 May 2021 06:36:44 +0000 (+0200) Subject: Fix selftest for targets where short and int are the same size. X-Git-Tag: upstream/12.2.0~7652 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=41ddc5b0a6b44a9df53a259636fa3b534ae41cbe;p=platform%2Fupstream%2Fgcc.git Fix selftest for targets where short and int are the same size. 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. gcc/ChangeLog: * value-range.cc (range_tests_legacy): Use build_nonstandard_integer_type instead of int and short. --- diff --git a/gcc/value-range.cc b/gcc/value-range.cc index 8d7b46c..f113fd7 100644 --- a/gcc/value-range.cc +++ b/gcc/value-range.cc @@ -2250,11 +2250,13 @@ range_tests_legacy () } // VARYING of different sizes should not be equal. - int_range_max r0 (integer_type_node); - int_range_max r1 (short_integer_type_node); + tree big_type = build_nonstandard_integer_type (32, 1); + tree small_type = build_nonstandard_integer_type (16, 1); + int_range_max r0 (big_type); + int_range_max r1 (small_type); ASSERT_TRUE (r0 != r1); - value_range vr0 (integer_type_node); - int_range_max vr1 (short_integer_type_node); + value_range vr0 (big_type); + int_range_max vr1 (small_type); ASSERT_TRUE (vr0 != vr1); }