From: Andrew Pinski Date: Wed, 29 Mar 2023 21:34:30 +0000 (+0000) Subject: Fix fc-prototypes usage with C_INT64_T and non LP64 Targets. X-Git-Tag: releases/gcc-12.3.0~146 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=429b75db39aa899f93e46ef77650fca4f1b02fe5;p=thirdparty%2Fgcc.git Fix fc-prototypes usage with C_INT64_T and non LP64 Targets. 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. --- diff --git a/gcc/fortran/dump-parse-tree.cc b/gcc/fortran/dump-parse-tree.cc index 3635460bffd3..581f78e03858 100644 --- a/gcc/fortran/dump-parse-tree.cc +++ b/gcc/fortran/dump-parse-tree.cc @@ -3600,7 +3600,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)