public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/51842] fortran fails if ssize_t is 32-bit on 64-bit host
Date: Fri, 13 Jan 2012 10:38:00 -0000 [thread overview]
Message-ID: <bug-51842-4-6J2hw6FBct@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-51842-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51842
--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-01-13 10:34:01 UTC ---
(In reply to comment #5)
> Yes, and no. It is perhaps a better match for the current frontend logic of
> choosing a type equal to the pointer size, but semantically ptrdiff_t is the
> better choice for array indexing.
OK. But then the logical step is to change the FE - how about something like
the following?
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -576,10 +576,7 @@ 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;
- /* Pick a kind the same size as the C "int" type. */
- gfc_c_int_kind = INT_TYPE_SIZE / 8;
+ gfc_index_integer_kind = get_int_kind_from_name (PTRDIFF_TYPE);
/* Choose atomic kinds to match C's int. */
gfc_atomic_int_kind = gfc_c_int_kind;
next prev parent reply other threads:[~2012-01-13 10:34 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-13 3:48 [Bug fortran/51842] New: " mrs at gcc dot gnu.org
2012-01-13 9:08 ` [Bug fortran/51842] " jb at gcc dot gnu.org
2012-01-13 9:31 ` burnus at gcc dot gnu.org
2012-01-13 9:32 ` burnus at gcc dot gnu.org
2012-01-13 9:51 ` burnus at gcc dot gnu.org
2012-01-13 10:26 ` jb at gcc dot gnu.org
2012-01-13 10:38 ` burnus at gcc dot gnu.org [this message]
2012-01-13 11:51 ` jb at gcc dot gnu.org
2012-01-13 15:50 ` burnus at gcc dot gnu.org
2012-01-13 17:37 ` mrs at gcc dot gnu.org
2012-01-13 20:18 ` jb at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-51842-4-6J2hw6FBct@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).