diff options
author | Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2010-10-19 12:30:35 +0000 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2010-10-19 12:30:35 +0000 |
commit | d35ce1095280dd3e5c3c9cc3fca7944288803649 (patch) | |
tree | 02f60c07524ec76d2cd1aaa762d3f68c4b17464d /gcc | |
parent | a961aa79587ca417a9920cd2ba4df4d3144fd26d (diff) | |
download | gcc-d35ce1095280dd3e5c3c9cc3fca7944288803649.zip gcc-d35ce1095280dd3e5c3c9cc3fca7944288803649.tar.gz gcc-d35ce1095280dd3e5c3c9cc3fca7944288803649.tar.bz2 |
re PR fortran/43414 (DWARF4: Use DW_AT_main_subprogram for MAIN__)
PR fortran/43414
* dwarf2out.c (add_calling_convention_attribute): Flag main
Fortran subroutine with DW_AT_main_subprogram.
From-SVN: r165699
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 19 |
2 files changed, 19 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e124df7..38d07c7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 47d98f3..d19a5cd 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -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. */ |