http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46477
Summary: GCC doesn't understand %c in asm instruction with -mcmodel=large Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassig...@gcc.gnu.org ReportedBy: _kirpich...@mail.ru Hi, I'm trying to compile the following code snippet: #ifdef CONFIG_X86_32 # define __BUG_C0 "2:\t.long 1b, %c0\n" #else # define __BUG_C0 "2:\t.long 1b - 2b, %c0 - 2b\n" #endif #define BUG() \ do { \ asm volatile("1:\tud2\n" \ ".pushsection __bug_table,\"a\"\n" \ __BUG_C0 \ "\t.word %c1, 0\n" \ "\t.org 2b+%c2\n" \ ".popsection" \ : : "i" (__FILE__), "i" (__LINE__), \ "i" (10*sizeof(int))); \ } while (0) int main() { BUG(); } And everything is ok until -mcmodel=large is used. When I'm trying to use -mcmodel=large the following error appears: main.c:24:9: error: invalid 'asm': operand is neither a constant nor a condition code, invalid operand code 'c' gcc -dumpversion 4.5 BTW, if I change %c on %P then everything is ok and generated code looks the same, but I didn't find any documentation about %P.