int main(int argc, char *argv[]) { void *frame = malloc(40); /* This compiles fine */ asm volatile ( "movq %0, %%rax\n\t" "movq %%rbp, 16(%%rax)\n\t" "movq %%rsp, 8(%%rax)\n\t" : : "g" (frame) : "rax", "rbx" ); asm volatile ( "leaq 4(%%rip), %%rbx\n\t" "movq %%rbx, 24(%%rax)\n\t" : : : "rbx" ); /* This does not compiles */ asm volatile ( "movq %0, %%rax\n\t" "movq %%rbp, 16(%%rax)\n\t" "movq %%rsp, 8(%%rax)\n\t" "leaq 4(%%rip), %%rbx\n\t" "movq %%rbx, 24(%%rax)\n\t" : : "g" (frame) : "rax", "rbx" ); return 0; }