[simplify.c] bug?
Jerry DeLisle
jvdelisle@verizon.net
Sun Jun 12 05:09:00 GMT 2005
While playing with implementing simplify for atanh function I noticed
the following:
$ cat asin.f90
program test_asin
real(8) :: x = .5
real(8) :: y
y = asin(1.1)
print *, x, y, sin(y)
end program test_asin
$ gfc asin.f90
In file asin.f90:4
y = asin(1.1)
1
Error: Argument of ASIN at (1) must be between -1 and 1
Using asin(1.1_4) correctly gives the same error message.
However asin(1.1_8) is not caught evidently because 1.1_8 is not
determined to be an EXPR_CONSTANT. So, gfc_simplify_asin exits before
the test for out of range is done and the constant is not simplfied further.
The result returns NaN at run time appropriately, but the error is not
caught at compile time similar to 1.1_4.
Should 1.1_8 give the same result as 1.1_4 at compile time?
Jerry
More information about the Fortran
mailing list