OSDN Git Service

2011-08-01 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Aug 2011 11:51:04 +0000 (11:51 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 1 Aug 2011 11:51:04 +0000 (11:51 +0000)
* stor-layout.c (initialize_sizetypes): Properly sign-extend
bitsiztype TYPE_MAX_VALUE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177016 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/stor-layout.c

index da6e982..b1d0b99 100644 (file)
@@ -1,3 +1,8 @@
+2011-08-01  Richard Guenther  <rguenther@suse.de>
+
+       * stor-layout.c (initialize_sizetypes): Properly sign-extend
+       bitsiztype TYPE_MAX_VALUE.
+
 2011-08-01  Julian Brown  <julian@codesourcery.com>
 
        * optabs.c (prepare_cmp_insn): Use correct biasing for fixed-point
index 8a5c48d..e488741 100644 (file)
@@ -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));