The following Fortran program program test complex :: z real :: r r = abs(z)**2 print *, r end program test produces the following tree: D.1352 = __builtin_cabsf (z); D.1353 = D.1352 * D.1352; r = D.1353; The complex value is naively calculated as: sqrt( (_Real_ z)*(_Real_ z) + (_Imag_ z)*(_Imag_ z) ) However, since the value is squared afterwards, the square root can be simply removed. Calculating |...|^2 is not that uncommon in some codes.

Confirmed.

(In reply to comment #0) > The complex value is naively calculated as: > sqrt( (_Real_ z)*(_Real_ z) + (_Imag_ z)*(_Imag_ z) ) > > However, since the value is squared afterwards, the square root can be simply > removed. This optimization can also be applied to squared hypot().