Issue 239139
Summary [clang] Crash on a _Complex rvalue as an inline asm input
Labels clang:codegen, crash-on-valid
Assignees
Reporter isanbard
    *(Written by Claude, Bill's AI coding assistant; Bill reviewed and approved this before it was posted.)*

A `_Complex` rvalue as an inline asm input crashes Clang:

```c
void f(_Complex float a, _Complex float b) {
  asm volatile("" :: "r"(a + b));
}
```

```
CGExpr.cpp:6866: LValue clang::CodeGen::CodeGenFunction::EmitBinaryOperatorLValue(const BinaryOperator *): Assertion `E->getOpcode() == BO_Assign && "unexpected binary l-value"' failed.
...
#13 clang::CodeGen::CodeGenFunction::EmitLValue(...)
#14 clang::CodeGen::CodeGenFunction::EmitAsmInput(...)
#15 clang::AsmConstraintsInfo::HandleInputConstraints()
```

`EmitAsmInput` handles a non-scalar input with `EmitLValue`, which works for a struct rvalue such as a call, but not for a `_Complex` one. A scalar input like `"r"(x + y)` is fine.

Seen on main 3d534989cdf0.

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to