[llvm-branch-commits] [clang] [Clang][CodeGen] Add support for _Complex inline asm register outputs (PR #236695)

Bill Wendling via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 2 13:01:53 PST 2026


bwendling wrote:

> ```
> $ cat repro.c
> _Complex double g(_Complex double c) {
>   asm goto("" : "+r"(c) : : : l);
>   return c;
> l:
>   return -c;
> }
> 
> $ ~/llvm-project/build-pr-236695/bin/clang repro.c -S -O0
> repro.c:2:12: error: inline asm not supported yet: cannot handle tied indirect register inputs
>     2 |   asm goto("" : "+r"(c) : : : l);
>       |            ^
> clang: ~/llvm-project/wt-pr-236695/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:13285: Register FollowCopyChain(MachineRegisterInfo &, Registe
> r): Assertion `MI->getOpcode() == TargetOpcode::COPY && "start of copy chain MUST be COPY"' failed.
> PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
> Stack dump:
> 0.      Program arguments: ~/llvm-project/build-pr-236695/bin/clang repro.c -S -O0
> 1.      <eof> parser at end of file
> 2.      Code generation
> 3.      Running pass 'Function Pass Manager' on module 'repro.c'.
> 4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@g'
>  #0 0x000055d8afa31a8b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (~/llvm-project/build-pr-236695/bin/clang+0x4f60a8b)
>  #1 0x000055d8afa2e951 llvm::sys::RunSignalHandlers() (~/llvm-project/build-pr-236695/bin/clang+0x4f5d951)
>  #2 0x000055d8afa3060d llvm::sys::CleanupOnSignal(unsigned long) (~/llvm-project/build-pr-236695/bin/clang+0x4f5f60d)
>  #3 0x000055d8af990bf5 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
>  #4 0x00007f2e9664bd70 (/lib/x86_64-linux-gnu/libc.so.6+0x3fd70)
>  #5 0x00007f2e966a069c (/lib/x86_64-linux-gnu/libc.so.6+0x9469c)
>  #6 0x00007f2e9664bc42 raise (/lib/x86_64-linux-gnu/libc.so.6+0x3fc42)
>  #7 0x00007f2e966344ac abort (/lib/x86_64-linux-gnu/libc.so.6+0x284ac)
>  #8 0x00007f2e96634420 __assert_perror_fail (/lib/x86_64-linux-gnu/libc.so.6+0x28420)
>  #9 0x000055d8b1816d48 llvm::SelectionDAGBuilder::visitCallBrLandingPad(llvm::CallInst const&) (~/llvm-project/build-pr-236695/bin/clang+0x6d45d48)
> #10 0x000055d8b1803ca0 llvm::SelectionDAGBuilder::visitIntrinsicCall(llvm::CallInst const&, unsigned int) (~/llvm-project/build-pr-236695/bin/clang+0x6
> <snip>
> ```
> 
> whereas mainline clang:
> 
> ```
> repro.c:2:12: error: inline asm not supported yet: cannot handle tied indirect register inputs
>     2 |   asm goto("" : "+r"(c) : : : l);
>       |            ^
> 1 error generated.
> ```

That's one of the testcases. Did you include the whole stack of PRs when testing this one?

https://github.com/llvm/llvm-project/pull/236695


More information about the llvm-branch-commits mailing list