This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/48174] DWARF for subroutine with no args indicates 'varargs'
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 19 Mar 2011 23:26:30 +0000
- Subject: [Bug fortran/48174] DWARF for subroutine with no args indicates 'varargs'
- Auto-submitted: auto-generated
- References: <bug-48174-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48174
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu.org
--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-03-19 23:26:22 UTC ---
Hmm, I am surprised about this PR. The test case from comment 0 indicates that
the FE generates the wrong declaration for the procedure (subroutine) itself. I
was only aware about issues where the declaration of procedures with implicit
interfaces caused problems (e.g. PR 40976, PR 33097, PR 44471).
As the interface is explicitly known, it should be rather straight forward to
fix this issue (contrary to the other PRs) ...
Untested draft patch. (I am not sure about the if_source part, but I think
leaving it as is should be best for the moment; the real solution for that part
is to fix the issue outlined in the first paragraph.)
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -2618,7 +2618,7 @@ gfc_get_function_type (gfc_symbol * sym)
if (typelist)
typelist = chainon (typelist, void_list_node);
- else if (sym->attr.is_main_program)
+ else if (sym->attr.if_source != IFSRC_UNKNOWN)
typelist = void_list_node;
if (alternate_return)