http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60060
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Tobias Burnus from comment #6) > (In reply to Dominique d'Humieres from comment #0) > > warning: invalid DWARF generated by the compiler: DIE 0x000001f0 has > > multiple AT_calling_convention attributes in > > '/var/folders/8q/sh_swgz96r7f5vnn08f7fxr00000gn/T//ccLHCwpM.ltrans0.ltrans. > > o'. > > (In reply to Dominique d'Humieres from comment #5) > > The ICE is gone with the patch in comment 4 without regression. However on > > darwin I still get the warnings reported in comment 0. > > The calling convention should be (except on sh, cf. sh/sh.c's > TARGET_DWARF_CALLING_CONVENTION) be always DW_CC_normal - which is not > emitted as DWARF symbol. The only exception is Fortran's MAIN__ function, > which is set to DW_CC_program. > > I wonder whether you see twice DW_CC_program or some other DW_CC_*. You > could try readelf to find out which AT_calling_convention are generated. I see <1><18c>: Abbrev Number: 3 (DW_TAG_subprogram) <18d> DW_AT_name : (indirect string, offset: 0x175): mem_nml <191> DW_AT_decl_file : 1 <192> DW_AT_decl_line : 4 <193> DW_AT_main_subprogram: 1 <193> DW_AT_calling_convention: 2 (program) <194> DW_AT_inline : 1 (inlined) <195> DW_AT_main_subprogram: 1 <195> DW_AT_calling_convention: 2 (program) <196> DW_AT_sibling : <0x50b> with -O3 -g -flto and <1><185>: Abbrev Number: 2 (DW_TAG_subprogram) <186> DW_AT_name : (indirect string, offset: 0x1e0): mem_nml <18a> DW_AT_decl_file : 1 <18b> DW_AT_decl_line : 4 <18c> DW_AT_main_subprogram: 1 <18c> DW_AT_calling_convention: 2 (program) <18d> DW_AT_low_pc : 0x400f45 <195> DW_AT_high_pc : 0x15 <19d> DW_AT_frame_base : 1 byte block: 9c (DW_OP_call_frame_cfa) <19f> DW_AT_GNU_all_tail_call_sites: 1 <19f> DW_AT_main_subprogram: 1 <19f> DW_AT_calling_convention: 2 (program) <1a0> DW_AT_sibling : <0x2a3> with -g Looks like a different bug - can you please file it separately as this bug assigned to me is about LTO issues? add_calling_convention_attribute is called twice. First via Breakpoint 5, add_calling_convention_attribute (subr_die=0x7ffff6da1730, decl= <function_decl 0x7ffff6d7e700 mem_nml>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16859 16859 enum dwarf_calling_convention value = DW_CC_normal; Missing separate debuginfos, use: zypper install glibc-debuginfo-2.18-4.11.1.x86_64 libgmp10-debuginfo-5.1.3-58.2.x86_64 (gdb) bt #0 add_calling_convention_attribute (subr_die=0x7ffff6da1730, decl=<function_decl 0x7ffff6d7e700 mem_nml>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16859 #1 0x00000000008bc477 in gen_subprogram_die ( decl=<function_decl 0x7ffff6d7e700 mem_nml>, context_die=0x7ffff6d71000) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18535 #2 0x00000000008c1668 in force_decl_die ( decl=<function_decl 0x7ffff6d7e700 mem_nml>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20119 #3 0x00000000008c1581 in get_context_die ( context=<function_decl 0x7ffff6d7e700 mem_nml>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20089 #4 0x00000000008c15e6 in force_decl_die (decl=<var_decl 0x7ffff6d77e40 nxc>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20105 #5 0x00000000008c2fb0 in gen_namelist_decl ( name=<identifier_node 0x7ffff6d7cac8 input>, scope_die=0x7ffff6da1640, item_decls=<constructor 0x7ffff6d735d0>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20672 #6 0x00000000008c27d0 in gen_decl_die ( decl=<namelist_decl 0x7ffff6c507e8 input>, origin=<tree 0x0>, context_die=0x7ffff6da1640) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20475 #7 0x00000000008c0d75 in process_scope_var (stmt=<block 0x7ffff6d713c0>, decl=<namelist_decl 0x7ffff6c507e8 input>, origin=<tree 0x0>, context_die=0x7ffff6da1640) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:19984 #8 0x00000000008c0df1 in decls_for_scope (stmt=<block 0x7ffff6d713c0>, context_die=0x7ffff6da1640, depth=0) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20009 #9 0x00000000008bbd94 in gen_subprogram_die ( decl=<function_decl 0x7ffff6d7e800 readnamelist>, context_die=0x0) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18383 #10 0x00000000008c220a in gen_decl_die ( decl=<function_decl 0x7ffff6d7e800 readnamelist>, origin=<tree 0x0>, context_die=0x0) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20376 #11 0x00000000008c345f in dwarf2out_decl ( decl=<function_decl 0x7ffff6d7e800 readnamelist>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20808 #12 0x00000000008c3481 in dwarf2out_function_decl ( decl=<function_decl 0x7ffff6d7e800 readnamelist>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20816 #13 0x000000000092e677 in rest_of_handle_final () and once via Breakpoint 5, add_calling_convention_attribute (subr_die=0x7ffff6da1640, decl=<function_decl 0x7ffff6d7e800 readnamelist>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16859 16859 enum dwarf_calling_convention value = DW_CC_normal; #0 add_calling_convention_attribute (subr_die=0x7ffff6da1640, decl=<function_decl 0x7ffff6d7e800 readnamelist>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:16859 #1 0x00000000008bc477 in gen_subprogram_die ( decl=<function_decl 0x7ffff6d7e800 readnamelist>, context_die=0x0) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:18535 #2 0x00000000008c220a in gen_decl_die ( decl=<function_decl 0x7ffff6d7e800 readnamelist>, origin=<tree 0x0>, context_die=0x0) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20376 #3 0x00000000008c345f in dwarf2out_decl ( decl=<function_decl 0x7ffff6d7e800 readnamelist>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20808 #4 0x00000000008c3481 in dwarf2out_function_decl ( decl=<function_decl 0x7ffff6d7e800 readnamelist>) at /space/rguenther/src/svn/trunk/gcc/dwarf2out.c:20816 #5 0x000000000092e677 in rest_of_handle_final ()