Issue 97673
Summary [assemble] clang doesn't accept the operand %1
Labels clang
Assignees
Reporter vfdff
    * test: https://gcc.godbolt.org/z/e1c1qMTTM
```
void _mcount(uint64_t caller_ra){
	uint64_t rbp=0;
	uint64_t rsp=0;
	__asm__ __volatile__("mov x0, fp\n"
                         "mov %1, sp \n"
                         :"=g"(rbp),"=g"(rsp)       
 :); 
	
	printf("rbp = 0x%llx , rsp=0x%llx\n" , rbp , rsp);
}
```

I except the register value **sp** will be saved in local variable **rsp**. But it is only accept by gcc

* error reported by clang:
```
<source>:9:27: error: invalid operand for instruction
    9 |                          "mov %1, sp \n"
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to