diff mbox

Handle SIZE_TYPE as unsigned short

Message ID 4E35FD84.4000903@redhat.com
State New
Headers show

Commit Message

Richard Henderson Aug. 1, 2011, 1:12 a.m. UTC
Some multilibs for H8 have 16-bit Pmode and 32-bit "int".
Which makes size_t be unsigned short.


r~
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7df0ee2..a35b0e8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@ 
+2011-07-31  Richard Henderson  <rth@redhat.com>
+
+	* stor-layout.c (initialize_sizetypes): Handle unsigned short.
+	* tree.c (build_common_tree_nodes): Likewise.
+
 2011-07-31  Kaz Kojima  <kkojima@gcc.gnu.org>
 
 	PR target/49880
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index fee26e6..8a5c48d 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -2203,6 +2203,8 @@  initialize_sizetypes (void)
     precision = LONG_TYPE_SIZE;
   else if (strcmp (SIZE_TYPE, "long long unsigned int") == 0)
     precision = LONG_LONG_TYPE_SIZE;
+  else if (strcmp (SIZE_TYPE, "short unsigned int") == 0)
+    precision = SHORT_TYPE_SIZE;
   else
     gcc_unreachable ();
 
diff --git a/gcc/tree.c b/gcc/tree.c
index 30ff80f..c474b73 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -9228,6 +9228,8 @@  build_common_tree_nodes (bool signed_char, bool short_double)
     size_type_node = long_unsigned_type_node;
   else if (strcmp (SIZE_TYPE, "long long unsigned int") == 0)
     size_type_node = long_long_unsigned_type_node;
+  else if (strcmp (SIZE_TYPE, "short unsigned int") == 0)
+    size_type_node = short_unsigned_type_node;
   else
     gcc_unreachable ();