------- Comment #10 from hjl dot tools at gmail dot com 2009-08-05 19:49 ------- (In reply to comment #9)
> Thanks! I think the following patch should cure this. I think we will still > have issues with LTO but those are inevitable and need to be solved on the > middle end. > > Index: trans-types.c > =================================================================== > --- trans-types.c (Revision 150497) > +++ trans-types.c (Arbeitskopie) > @@ -2324,7 +2324,10 @@ > while (nstr--) > typelist = gfc_chainon_list (typelist, gfc_charlen_type_node); > > - typelist = gfc_chainon_list (typelist, void_type_node); > + /* If the explicit interface is known, we tell the middle end > + that no more additional arguments will follow in calls. */ > + if (sym->attr.if_source != IFSRC_UNKNOWN) > + typelist = gfc_chainon_list (typelist, void_type_node); > > if (alternate_return) > type = integer_type_node; > It failed at a different place: (gdb) bt #0 0xa000000000010621 in __kernel_syscall_via_break () #1 0x20000000003e7630 in raise () from /lib/tls/libc.so.6.1 #2 0x20000000003ea010 in abort () from /lib/tls/libc.so.6.1 #3 0x4000000000001ac0 in c_to_c__ (retval=0x60000fffffffb498, c1=43 + 0 * I, c2=0x60000fffffffb480, c3=0x60000fffffffb3e8) at /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gfortran.dg/c_by_val.c:61 #4 0x4000000000000f50 in c_by_val_1 () at /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gfortran.dg/c_by_val_1.f:42 #5 0x4000000000001430 in main (argc=1, argv=0x60000fffffffb983 "/export/build/gnu/gcc-work/build-ia64-linux/gcc/testsuite/gfortran/c_by_val_1.exe") at /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gfortran.dg/c_by_val_1.f:52 #6 0x20000000003bd430 in __libc_start_main () from /lib/tls/libc.so.6.1 #7 0x40000000000008a0 in _start () (gdb) f 3 #3 0x4000000000001ac0 in c_to_c__ (retval=0x60000fffffffb498, c1=43 + 0 * I, c2=0x60000fffffffb480, c3=0x60000fffffffb3e8) at /net/gnu-13/export/gnu/src/gcc/gcc/gcc/testsuite/gfortran.dg/c_by_val.c:61 61 if ( c1 != *c2 ) abort(); (gdb) p c1 $1 = 43 + 0 * I (gdb) p *c2 $2 = -1 + 2 * I (gdb) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40969