------- Comment #3 from toon at moene dot org 2010-05-16 18:51 ------- It might be useful to compare the two decls that invoke the mismatch that triggers the gcc_assert:
prevailing->decl is: <function_decl 0x7fb0f574f900 convect_satmixratio type <function_type 0x7fb0f5786b28 type <void_type 0x7fb0f584cd20 VOID align 8 symtab 0 alias set -1 canonical type 0x7fb0f584cd20 pointer_to_this <pointer_type 0x7fb0f584cdc8>> QI size <integer_cst 0x7fb0f583d758 constant 8> unit size <integer_cst 0x7fb0f583d780 constant 1> align 8 symtab 0 alias set -1 canonical type 0x7fb0f5786b28> public external QI file bkfconv.f90 line 517 col 0 align 8> whereas e->decl is: <function_decl 0x7fb0f574f600 convect_satmixratio type <function_type 0x7fb0f5763b28 type <void_type 0x7fb0f584cd20 VOID align 8 symtab 0 alias set -1 canonical type 0x7fb0f584cd20 pointer_to_this <pointer_type 0x7fb0f584cdc8>> QI size <integer_cst 0x7fb0f583d758 constant 8> unit size <integer_cst 0x7fb0f583d780 constant 1> align 8 symtab 0 alias set -1 canonical type 0x7fb0f5763b28 arg-types <tree_list 0x7fb0f5754bb8 value <reference_type 0x7fb0f5750738> chain <tree_list 0x7fb0f5754be0 value <pointer_type 0x7fb0f5763bd0> chain <tree_list 0x7fb0f5754c08 value <pointer_type 0x7fb0f5764000> chain <tree_list 0x7fb0f5754c30 value <pointer_type 0x7fb0f57643f0> chain <tree_list 0x7fb0f5754c58 value <pointer_type 0x7fb0f57647e0> chain <tree_list 0x7fb0f5754c80>>>>>>> nothrow public static QI file bkfconv.f90 line 400 col 0 align 8 arguments <parm_decl 0x7fb0f5760660 klon type <reference_type 0x7fb0f5750738 type <integer_type 0x7fb0f584c498> unsigned restrict DI size <integer_cst 0x7fb0f583da50 constant 64> unit size <integer_cst 0x7fb0f583da78 constant 8> align 64 symtab 0 alias set -1 canonical type 0x7fb0f5750738> readonly used unsigned DI passed-by-reference file bkfconv.f90 line 400 col 0 size <integer_cst 0x7fb0f583da50 64> unit size <integer_cst 0x7fb0f583da78 8> align 64 context <function_decl 0x7fb0f574f600 convect_satmixratio> arg-type <reference_type 0x7fb0f5750738> chain <parm_decl 0x7fb0f57606e8 ppres type <pointer_type 0x7fb0f57653f0> readonly used unsigned DI passed-by-reference file bkfconv.f90 line 400 col 0 size <integer_cst 0x7fb0f583da50 64> unit size <integer_cst 0x7fb0f583da78 8> align 64 context <function_decl 0x7fb0f574f600 convect_satmixratio> arg-type <pointer_type 0x7fb0f5763bd0> chain <parm_decl 0x7fb0f5760770 pt>>> result <result_decl 0x7fb0f5752180 D.2157 type <void_type 0x7fb0f584cd20> ignored VOID file bkfconv.f90 line 400 col 0 align 8 context <function_decl 0x7fb0f574f600 convect_satmixratio>>> This is found by adding the following to lto-symtab.c: $ svn diff Index: lto-symtab.c =================================================================== --- lto-symtab.c (revision 159454) +++ lto-symtab.c (working copy) @@ -603,8 +603,15 @@ /* Assert it's the only one. */ if (prevailing) for (e = prevailing->next; e; e = e->next) - gcc_assert (e->resolution != LDPR_PREVAILING_DEF_IRONLY - && e->resolution != LDPR_PREVAILING_DEF); + { + if (!(e->resolution != LDPR_PREVAILING_DEF_IRONLY + && e->resolution != LDPR_PREVAILING_DEF)) + { + debug_tree(prevailing->decl); + debug_tree(e->decl); + gcc_assert(0); + } + } /* If there's not a prevailing symbol yet it's an external reference. Happens a lot during ltrans. Choose the first symbol with a -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44149