Consider this file: #include <stdio.h> int x = 1; int main () { asm goto ("decl %0; jnz %l[a]" :: "m"(x) : "memory" : a); printf ("Hello world\n"); a: return 0; }
It compiles and links correctly without LTO. But with LTO, "gcc-4.5.0 -flto a.c", there is an error: In file included from :0:0: a.c: In function 'main': a.c:7:2: error: invalid 'asm': operand number out of range lto-wrapper: /usr/bin/gcc-4.5.0 returned 1 exit status collect2: lto-wrapper returned 1 exit status -- Summary: "asm goto" does not work with LTO Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: lto AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: richardpku at gmail dot com GCC build triplet: x86_64-pc-linux-gnu GCC host triplet: x86_64-pc-linux-gnu GCC target triplet: x86_64-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44184