re PR fortran/51842 (fortran fails if ssize_t is 32-bit on 64-bit host)
authorTobias Burnus <burnus@net-b.de>
Fri, 13 Jan 2012 15:41:13 +0000 (16:41 +0100)
committerTobias Burnus <burnus@gcc.gnu.org>
Fri, 13 Jan 2012 15:41:13 +0000 (16:41 +0100)
2012-01-13  Tobias Burnus  <burnus@net-b.de>

        PR fortran/51842
        * fortran/trans-types.c (gfc_init_kinds): Use PTRDIFF_TYPE
        instead of a signed int of size POINTER_SIZE for
        gfc_index_integer_kind.

From-SVN: r183154

gcc/fortran/ChangeLog
gcc/fortran/trans-types.c

index 000516173da0fa004cfd482477388b36318c17dd..9a382164f253bc0f30009593d5d82b3b3e195680 100644 (file)
@@ -1,3 +1,10 @@
+2012-01-13  Tobias Burnus  <burnus@net-b.de>
+
+       PR fortran/51842
+       * fortran/trans-types.c (gfc_init_kinds): Use PTRDIFF_TYPE
+       instead of a signed int of size POINTER_SIZE for
+       gfc_index_integer_kind.
+
 2012-01-12  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/36755
index d643c2e45b8d18778596426a5aa9344fd9034118..f817a12f6ec920c9b49a15bfd628814ea04454e4 100644 (file)
@@ -576,8 +576,8 @@ gfc_init_kinds (void)
   gfc_default_character_kind = gfc_character_kinds[0].kind;
   gfc_character_storage_size = gfc_default_character_kind * 8;
 
-  /* Choose the integer kind the same size as "void*" for our index kind.  */
-  gfc_index_integer_kind = POINTER_SIZE / 8;
+  gfc_index_integer_kind = get_int_kind_from_name (PTRDIFF_TYPE);
+
   /* Pick a kind the same size as the C "int" type.  */
   gfc_c_int_kind = INT_TYPE_SIZE / 8;