http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47602
Summary: Permit inline asm to clobber PIC register
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: rtl-optimization
AssignedTo: [email protected]
ReportedBy: [email protected]
This fails for i386 32-bit when using -fpic:
void foo() { asm volatile ("movl $0,%%ebx" : : : "ebx"); }
The compiler reports
foo.c:1:14: error: PIC register clobbered by ‘ebx’ in ‘asm’
This forces people to write their asm statements differently for PIC and
non-PIC code. That is not useful. The compiler could save and restore the PIC
register around the asm statement. That would be more useful, and that is what
we should do.