https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87689

--- Comment #12 from Alan Modra <amodra at gmail dot com> ---
A little more sophisticated.

        * fortran/trans-types.c (gfc_get_function_type): Use a varargs decl
        unless we have args other than hidden ones.

--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -3066,6 +3066,7 @@ gfc_get_function_type (gfc_symbol * sym)
             actual parameters for a dummy procedure.  */

          vec_safe_push (typelist, type);
+         is_varargs = false;
        }
       else
         {
@@ -3092,8 +3093,7 @@ gfc_get_function_type (gfc_symbol * sym)
        }
     }

-  if (!vec_safe_is_empty (typelist)
-      || sym->attr.is_main_program
+  if (sym->attr.is_main_program
       || sym->attr.if_source != IFSRC_UNKNOWN)
     is_varargs = false;

Reply via email to