public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <apinski@marvell.com>
To: <gcc-patches@gcc.gnu.org>, <fortran@gcc.gnu.org>
Cc: Andrew Pinski <apinski@marvell.com>
Subject: [PATCH] Fix fc-prototypes usage with C_INT64_T and non LP64 Targets.
Date: Wed, 29 Mar 2023 20:47:53 -0700	[thread overview]
Message-ID: <20230330034753.3661606-1-apinski@marvell.com> (raw)

The problem here is we were outputing long_long instead of
"long long". This was just an oversight and a missing check.

Committed as obvious after a bootstrap/test on x86_64-linux-gnu.

gcc/fortran/ChangeLog:

	* dump-parse-tree.cc (get_c_type_name): Fix "long_long"
	type name to be "long long". Add a comment on why adding
	2 to the name too.
---
 gcc/fortran/dump-parse-tree.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc
index 3b24bdc1a6c..f4490da6a19 100644
--- a/gcc/fortran/dump-parse-tree.cc
+++ b/gcc/fortran/dump-parse-tree.cc
@@ -3696,7 +3696,10 @@ get_c_type_name (gfc_typespec *ts, gfc_array_spec *as, const char **pre,
 	  if (c_interop_kinds_table[i].f90_type == ts->type
 	      && c_interop_kinds_table[i].value == ts->kind)
 	    {
+	      /* Skip over 'c_'. */
 	      *type_name = c_interop_kinds_table[i].name + 2;
+	      if (strcmp (*type_name, "long_long") == 0)
+		*type_name = "long long";
 	      if (strcmp (*type_name, "signed_char") == 0)
 		*type_name = "signed char";
 	      else if (strcmp (*type_name, "size_t") == 0)
-- 
2.17.1


             reply	other threads:[~2023-03-30  3:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-30  3:47 Andrew Pinski [this message]
2023-03-30 17:39 ` Thomas Koenig
2023-03-30 19:05   ` Steve Kargl
2023-04-01  8:24     ` Thomas Koenig

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=20230330034753.3661606-1-apinski@marvell.com \
    --to=apinski@marvell.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@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).