https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90793
Bug ID: 90793 Summary: adding -fPIC leads to compilation error Product: gcc Version: 10.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: zhonghao at pku dot org.cn Target Milestone: --- My gcc is 10.0.0, and my code is: void f(void) { __asm volatile("" : : "i" (f)); } It compiles well, but after adding -fPIC, I got a message: source>: In function 'void f()': <source>:4:32: warning: 'asm' operand 0 probably does not match constraints 4 | __asm volatile("" : : "i" (f)); | ^ <source>:4:32: error: impossible constraint in 'asm' Compiler returned: 1