https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102392
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |enhancement Ever confirmed|0 |1 Last reconfirmed| |2021-09-18 Status|UNCONFIRMED |NEW Component|target |tree-optimization Keywords|ABI | --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- A better testcase is: void g(int32_t *x, int64_t *y) { if (*x < 0) __builtin_unreachable(); *y = (*x); } To see what LLVM is really doing. GCC: movslq (%rdi), %rax movq %rax, (%rsi) ret VS LLVM: movl (%rdi), %eax movq %rax, (%rsi) retq There might be a dup of this bug somewhere too.