Issue 76324
Summary [Flang] Complex division operator overflows needlessly.
Labels flang
Assignees
Reporter chandankds
    Complex division produces Infinity in results that can be computed without overflow.

The Intel compiler does not overflow this case, GNU does.

```
Program test_complex_division_overflow
 Real(Kind(1.d0)) :: x, y
  x = Huge(0.d0)
  y = 2.d0
  Call ops(x,y)
  Contains
    Subroutine ops(n,d)
      Real(Kind(1.d0)) :: n,d
      Complex(Kind(1.d0)) :: a,b
      a = Cmplx(n,-n,Kind(1.d0))
      b = Cmplx(d,d,Kind(1.d0))
      Print *,a/b ! avoids infinity?
    End Subroutine ops
End Program test_complex_division_overflow
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to