void test_dcmplx(double _Complex a) {
#pragma omp target
  { (void)(a * (a / a)); }
}


x86 assembly (clang, -O0):
<test_dcmplx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x8(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm3
call   1480 <__divdc3>
movsd  -0x38(%rbp),%xmm2
movaps %xmm0,%xmm4
movsd  %xmm4,-0x30(%rbp)
movaps %xmm1,%xmm5
movsd  -0x28(%rbp),%xmm1
movsd  %xmm5,-0x20(%rbp)
movaps %xmm1,%xmm0
mulsd  %xmm4,%xmm0
movaps %xmm2,%xmm3
mulsd  %xmm5,%xmm3
mulsd  %xmm5,%xmm1
mulsd  %xmm4,%xmm2
subsd  %xmm3,%xmm0
addsd  %xmm2,%xmm1
movsd  %xmm1,-0x18(%rbp)
ucomisd %xmm0,%xmm0
jnp    11ae <test_dcmplx+0xae>
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm0,%xmm0
jnp    11ae <test_dcmplx+0xae>
movsd  -0x20(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
call   11c0 <__muldc3>
add    $0x40,%rsp
pop    %rbp
ret
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax

x86 assembly (clang, -O2):
<test_dcmplx>:
sub    $0x18,%rsp
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm0,%xmm2
movapd %xmm1,%xmm3
call   1440 <__divdc3>
movsd  0x10(%rsp),%xmm5
movsd  0x8(%rsp),%xmm4
movapd %xmm0,%xmm2
movapd %xmm1,%xmm3
mulsd  %xmm5,%xmm0
mulsd  %xmm4,%xmm1
subsd  %xmm1,%xmm0
ucomisd %xmm0,%xmm0
jp     1148 <test_dcmplx+0x48>
add    $0x18,%rsp
ret
movapd %xmm3,%xmm0
mulsd  %xmm5,%xmm0
movapd %xmm2,%xmm1
mulsd  %xmm4,%xmm1
addsd  %xmm0,%xmm1
ucomisd %xmm1,%xmm1
jnp    1143 <test_dcmplx+0x43>
movapd %xmm5,%xmm0
movapd %xmm4,%xmm1
add    $0x18,%rsp
jmp    1180 <__muldc3>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)

LLVM IR (-O0):
define void @test_dcmplx(double %0, double %1) {
%3 = alloca { double, double }
%4 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
store double %0, double* %4
%5 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
store double %1, double* %5
%6 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%9 = load double, double* %8
%10 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%11 = load double, double* %10
%12 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%13 = load double, double* %12
%14 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 0
%15 = load double, double* %14
%16 = getelementptr inbounds { double, double }, { double, double }* %3, i32 0, i32 1
%17 = load double, double* %16
%18 = call { double, double } @__divdc3(double %11, double %13, double %15, double %17)
%19 = extractvalue { double, double } %18, 0
%20 = extractvalue { double, double } %18, 1
%21 = fmul double %7, %19
%22 = fmul double %9, %20
%23 = fmul double %7, %20
%24 = fmul double %9, %19
%25 = fsub double %21, %22
%26 = fadd double %23, %24
%27 = fcmp uno double %25, %25
br i1 %27, label %28, label %34
28: ; preds = %2
%29 = fcmp uno double %26, %26
br i1 %29, label %30, label %34
30: ; preds = %28
%31 = call { double, double } @__muldc3(double %7, double %9, double %19, double %20)
%32 = extractvalue { double, double } %31, 0
%33 = extractvalue { double, double } %31, 1
br label %34
34: ; preds = %30, %28, %2
%35 = phi double [ %25, %2 ], [ %25, %28 ], [ %32, %30 ]
%36 = phi double [ %26, %2 ], [ %26, %28 ], [ %33, %30 ]
ret void
}

LLVM IR (-O2):
define void @test_dcmplx(double %0, double %1) {
%3 = tail call { double, double } @__divdc3(double %0, double %1, double %0, double %1)
%4 = extractvalue { double, double } %3, 0
%5 = extractvalue { double, double } %3, 1
%6 = fmul double %4, %0
%7 = fmul double %5, %1
%8 = fsub double %6, %7
%9 = fcmp uno double %8, 0.000000e+00
br i1 %9, label %10, label %17
10: ; preds = %2
%11 = fmul double %5, %0
%12 = fmul double %4, %1
%13 = fadd double %11, %12
%14 = fcmp uno double %13, 0.000000e+00
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = tail call { double, double } @__muldc3(double %0, double %1, double %4, double %5)
br label %17
17: ; preds = %15, %10, %2
ret void
}