This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Creating imaginary inf/nan in GCC


From: "Tobias Burnus" <burnus@net-b.de>

Hi Kaveh,

Kaveh R. GHAZI wrote:
I'm trying to create complex number expressions that contain inf or
nan in the imaginary part.  I.e. (0 + inf I) or (0 + nan I).

If it does not need to be C (e.g. to try MPC in the middle end), you could use Fortran:

! compile with gfortran -fno-range-check
complex :: z
z = cmplx(0.0, 0.0/0.0)
print *, z
end

Tobias

Thanks, I do want to test the middle-end. However I need to do more than just create the complex expression. I also have to pass it to a builtin that evaluates using MPC like __builtin_csin(). The fortran frontend evaluates complex transcendentals in fortran/simplify.c, not in the middle-end. So it wouldn't test what I want AFAICT. It's not a big deal, the nan cases are error paths that should *avoid* folding via MPC.


       Regards,
       --Kaveh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]