From: Tobias Burnus Date: Wed, 29 Jul 2009 14:44:51 +0000 (+0200) Subject: re PR fortran/40898 (STDCALL mangling problem for strings @8 instead of @4) X-Git-Tag: releases/gcc-4.5.0~4287 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=33215bb37f598adbbde2a90e301d37165072dcc2;p=thirdparty%2Fgcc.git re PR fortran/40898 (STDCALL mangling problem for strings @8 instead of @4) 2009-07-29 Tobias Burnus PR fortran/40898 * trans-types.c (gfc_get_function_type): Do not add hidden string-length argument for BIND(C) procedures. * trans-decl.c (create_function_arglist): Skip over nonexisting string-length arguments for BIND(C) procedures. From-SVN: r150216 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 623c601c1738..f89a8af3e38c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2009-07-29 Tobias Burnus + + PR fortran/40898 + * trans-types.c (gfc_get_function_type): Do not add hidden + string-length argument for BIND(C) procedures. + * trans-decl.c (create_function_arglist): Skip over nonexisting + string-length arguments for BIND(C) procedures. + 2009-07-28 Jakub Jelinek PR fortran/40878 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 65a6ac5cca9b..783c8f8308e2 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1724,7 +1724,8 @@ create_function_arglist (gfc_symbol * sym) type = TREE_VALUE (typelist); - if (f->sym->ts.type == BT_CHARACTER) + if (f->sym->ts.type == BT_CHARACTER + && (!sym->attr.is_bind_c || sym->attr.entry_master)) { tree len_type = TREE_VALUE (hidden_typelist); tree length = NULL_TREE; diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c index 77b8b9c66069..7b8423602809 100644 --- a/gcc/fortran/trans-types.c +++ b/gcc/fortran/trans-types.c @@ -2249,7 +2249,7 @@ gfc_get_function_type (gfc_symbol * sym) Contained procedures could pass by value as these are never used without an explicit interface, and cannot be passed as actual parameters for a dummy procedure. */ - if (arg->ts.type == BT_CHARACTER) + if (arg->ts.type == BT_CHARACTER && !sym->attr.is_bind_c) nstr++; typelist = gfc_chainon_list (typelist, type); }