Issue 181553
Summary clang generates an intruction that binutils doesn't understand
Labels clang
Assignees
Reporter mikulas-patocka
    Compile this function:
unsigned long shr(unsigned long x)
{
        return x >> 1;
}
with this command line: "clang-23 -m64 -O2 -mapxf -no-integrated-as -c shrq.c".

You get:
/tmp/shrq-9e6c3b.s: Assembler messages:
/tmp/shrq-9e6c3b.s:10: Error: operand type mismatch for `shr'
clang-23: error: assembler command failed with exit code 1 (use -v to see invocation)

The offending instruction is "{nf} shrq %rdi, %rax". It should be "{nf} shrq $1, %rdi, %rax"
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to