[Bug fortran/40318] New: Complex division by zero in gfortran returns wrong results

ghazi at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jun 1 06:15:00 GMT 2009


Complex division by zero in gfortran returns NaN.  This is expected for 0/0,
but other finite/zero should return Inf.  This impacts the testcase
gfortran.dg/real_const_3.f90 in two values incorrectly computed:

  complex :: z = (-0.1,-2.2)/(0.0,0.0)
  complex :: z2 = (0.1,1)/0

See: http://gcc.gnu.org/ml/fortran/2009-05/msg00423.html

This should be fixed in gcc-4.5 by using MPC for division, but older versions
of GCC should add special case handling in the fortran frontend simplification
code.


-- 
           Summary: Complex division by zero in gfortran returns wrong
                    results
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ghazi at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40318



More information about the Gcc-bugs mailing list