int main(void) {
  volatile float a = 1.3f;
  volatile double b = 0.0;
  volatile int c = 4;
  volatile float res;
  res = a / b;
  res = a / 0.0;
  res = 2.7f / b;
  res = 3.6 / (b = 0.0, b);
  res = c / b;
  res = b / c;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movss  0xefd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
xorps  %xmm1,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xea0(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  0xe76(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
movl   $0x3fa66666,-0x4(%rsp)
3f
movq   $0x0,-0x10(%rsp)
movl   $0x4,-0x8(%rsp)
movss  -0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
divsd  -0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rsp)
movss  -0x4(%rsp),%xmm0
xorps  %xmm1,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rsp)
movsd  0xeb2(%rip),%xmm0
divsd  -0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rsp)
movq   $0x0,-0x10(%rsp)
movsd  0xe99(%rip),%xmm0
divsd  -0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sdl -0x8(%rsp),%xmm0
divsd  -0x10(%rsp),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rsp)
movsd  -0x10(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl -0x8(%rsp),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rsp)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca double
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
store volatile float 0x3FF4CCCCC0000000, float* %2
store volatile double 0.000000e+00, double* %3
store volatile i32 4, i32* %4
%6 = load volatile float, float* %2
%7 = fpext float %6 to double
%8 = load volatile double, double* %3
%9 = fdiv double %7, %8
%10 = fptrunc double %9 to float
store volatile float %10, float* %5
%11 = load volatile float, float* %2
%12 = fpext float %11 to double
%13 = fdiv double %12, 0.000000e+00
%14 = fptrunc double %13 to float
store volatile float %14, float* %5
%15 = load volatile double, double* %3
%16 = fdiv double 0x40059999A0000000, %15
%17 = fptrunc double %16 to float
store volatile float %17, float* %5
store volatile double 0.000000e+00, double* %3
%18 = load volatile double, double* %3
%19 = fdiv double 3.600000e+00, %18
%20 = fptrunc double %19 to float
store volatile float %20, float* %5
%21 = load volatile i32, i32* %4
%22 = sitofp i32 %21 to double
%23 = load volatile double, double* %3
%24 = fdiv double %22, %23
%25 = fptrunc double %24 to float
store volatile float %25, float* %5
%26 = load volatile double, double* %3
%27 = load volatile i32, i32* %4
%28 = sitofp i32 %27 to double
%29 = fdiv double %26, %28
%30 = fptrunc double %29 to float
store volatile float %30, float* %5
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca float
%2 = alloca double
%3 = alloca i32
%4 = alloca float
%5 = bitcast float* %1 to i8*
store volatile float 0x3FF4CCCCC0000000, float* %1
%6 = bitcast double* %2 to i8*
store volatile double 0.000000e+00, double* %2
%7 = bitcast i32* %3 to i8*
store volatile i32 4, i32* %3
%8 = bitcast float* %4 to i8*
%9 = load volatile float, float* %1
%10 = fpext float %9 to double
%11 = load volatile double, double* %2
%12 = fdiv double %10, %11
%13 = fptrunc double %12 to float
store volatile float %13, float* %4
%14 = load volatile float, float* %1
%15 = fdiv float %14, 0.000000e+00
store volatile float %15, float* %4
%16 = load volatile double, double* %2
%17 = fdiv double 0x40059999A0000000, %16
%18 = fptrunc double %17 to float
store volatile float %18, float* %4
store volatile double 0.000000e+00, double* %2
%19 = load volatile double, double* %2
%20 = fdiv double 3.600000e+00, %19
%21 = fptrunc double %20 to float
store volatile float %21, float* %4
%22 = load volatile i32, i32* %3
%23 = sitofp i32 %22 to double
%24 = load volatile double, double* %2
%25 = fdiv double %23, %24
%26 = fptrunc double %25 to float
store volatile float %26, float* %4
%27 = load volatile double, double* %2
%28 = load volatile i32, i32* %3
%29 = sitofp i32 %28 to double
%30 = fdiv double %27, %29
%31 = fptrunc double %30 to float
store volatile float %31, float* %4
ret i32 0
}