[Bug rtl-optimization/47602] New: Permit inline asm to clobber PIC register
ian at airs dot com
gcc-bugzilla@gcc.gnu.org
Thu Feb 3 19:40:00 GMT 2011
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: unassigned@gcc.gnu.org
ReportedBy: ian@airs.com
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.
More information about the Gcc-bugs
mailing list