]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/40898 (STDCALL mangling problem for strings @8 instead of @4)
authorTobias Burnus <burnus@net-b.de>
Wed, 29 Jul 2009 14:44:51 +0000 (16:44 +0200)
committerTobias Burnus <burnus@gcc.gnu.org>
Wed, 29 Jul 2009 14:44:51 +0000 (16:44 +0200)
2009-07-29  Tobias Burnus  <burnus@net-b.de>

        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

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

index 623c601c1738d0853bfc19c0615aede64da9fb23..f89a8af3e38c14d954712606a7dea25d95d90a54 100644 (file)
@@ -1,3 +1,11 @@
+2009-07-29  Tobias Burnus  <burnus@net-b.de>
+
+       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  <jakub@redhat.com>
 
        PR fortran/40878
index 65a6ac5cca9b57cb333a4260b06046b039ad0ecb..783c8f8308e282209bb2a5c6a7d1a09c57fc8834 100644 (file)
@@ -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;
index 77b8b9c66069ed3dda7bc9a84a3f4001240397ae..7b84236028090d686fb8436f0f67fdfe92f77271 100644 (file)
@@ -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);
        }