Commit 2b4cd2dd authored by fxcoudert's avatar fxcoudert
Browse files

PR fortran/43414

	* dwarf2out.c (add_calling_convention_attribute): Flag main
	Fortran subroutine with DW_AT_main_subprogram.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165699 138bc75d-0d04-0410-961f-82ee72b054a4
parent 39d4bf68
2010-10-19 Francois-Xavier Coudert<fxcoudert@gcc.gnu.org>
PR fortran/43414
* dwarf2out.c (add_calling_convention_attribute): Flag main
Fortran subroutine with DW_AT_main_subprogram.
2010-10-19 Nick Clifton <nickc@redhat.com>
 
* config/rx/rx.c (rx_function_value): Small integer types are
......@@ -17848,14 +17848,21 @@ add_calling_convention_attribute (dw_die_ref subr_die, tree decl)
value = ((enum dwarf_calling_convention)
targetm.dwarf_calling_convention (TREE_TYPE (decl)));
 
/* DWARF doesn't provide a way to identify a program's source-level
entry point. DW_AT_calling_convention attributes are only meant
to describe functions' calling conventions. However, lacking a
better way to signal the Fortran main program, we use this for the
time being, following existing custom. */
if (is_fortran ()
&& !strcmp (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)), "MAIN__"))
value = DW_CC_program;
{
/* DWARF 2 doesn't provide a way to identify a program's source-level
entry point. DW_AT_calling_convention attributes are only meant
to describe functions' calling conventions. However, lacking a
better way to signal the Fortran main program, we used this for
a long time, following existing custom. Now, DWARF 4 has
DW_AT_main_subprogram, which we add below, but some tools still
rely on the old way, which we thus keep. */
value = DW_CC_program;
if (dwarf_version >= 4 || !dwarf_strict)
add_AT_flag (subr_die, DW_AT_main_subprogram, 1);
}
 
/* Only add the attribute if the backend requests it, and
is not DW_CC_normal. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment