------- Comment #2 from zsojka at seznam dot cz 2010-06-15 07:28 ------- Created an attachment (id=20912) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=20912&action=view) reduced testcase, -fkeep-inline-functions is not needed there
As the original testcase, this ICEs only in 4.6 too: $ /mnt/svn/gcc-trunk/binary-160687-lto-fortran-checking-yes-rtl/bin/g++ pr44540.C pr44540.C: In function 'void foo()': pr44540.C:3:6: internal compiler error: in add_substitution, at cp/mangle.c:386 However, in 4.5 and 4.4 (both with checking enabled), the symbol might be mangled wrongly - the "volatile" looks superfluous. It seems to be caused by the "noreturn" attribute. $ /mnt/svn/gcc-4_5/binary-160526-lto-fortran-checking-yes-rtl/bin/g++ pr44540.C /usr/lib/../lib64/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' /tmp/ccCkV1Jt.o: In function `foo()': pr44540.C:(.text+0x5): undefined reference to `baz(char const*, ...)' pr44540.C:(.text+0xa): undefined reference to `bar(void ( volatile*)(char const*, ...))' collect2: ld returned 1 exit status 4.6 shows the same message (including "volatile") when the "printf" attribute is removed. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44540