From e62a2b6e5c59d63f2fe3346300255d8d2a124b55 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 1 Aug 2011 11:51:04 +0000 Subject: [PATCH] stor-layout.c (initialize_sizetypes): Properly sign-extend bitsiztype TYPE_MAX_VALUE. 2011-08-01 Richard Guenther * stor-layout.c (initialize_sizetypes): Properly sign-extend bitsiztype TYPE_MAX_VALUE. From-SVN: r177016 --- gcc/ChangeLog | 5 +++++ gcc/stor-layout.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index da6e982b712..b1d0b99cb45 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2011-08-01 Richard Guenther + + * stor-layout.c (initialize_sizetypes): Properly sign-extend + bitsiztype TYPE_MAX_VALUE. + 2011-08-01 Julian Brown * optabs.c (prepare_cmp_insn): Use correct biasing for fixed-point diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 8a5c48de920..e488741f5a0 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -2247,7 +2247,11 @@ initialize_sizetypes (void) = size_int (GET_MODE_SIZE (TYPE_MODE (bitsizetype))); set_min_and_max_values_for_integral_type (bitsizetype, bprecision, /*is_unsigned=*/true); - /* ??? TYPE_MAX_VALUE is not properly sign-extended. */ + /* bitsizetype is unsigned but we need to fix TYPE_MAX_VALUE so that it is + sign-extended in a way consistent with force_fit_type. */ + TYPE_MAX_VALUE (bitsizetype) + = double_int_to_tree (bitsizetype, + tree_to_double_int (TYPE_MAX_VALUE (bitsizetype))); /* Create the signed variants of *sizetype. */ ssizetype = make_signed_type (TYPE_PRECISION (sizetype)); -- 2.30.2