When compiled complete, run make test, it reports:
not ok float 15 -- C:/msys/1.0/home/beta/ruby-1.9.3-p194/sample/test.rb:1410:in nan_test' not ok float 20 -- C:/msys/1.0/home/beta/ruby-1.9.3-p194/sample/test.rb:1410:in nan_test'
not ok float 25 -- C:/msys/1.0/home/beta/ruby-1.9.3-p194/sample/test.rb:1410:in nan_test' not ok float 30 -- C:/msys/1.0/home/beta/ruby-1.9.3-p194/sample/test.rb:1410:in nan_test'
not ok float 35 -- C:/msys/1.0/home/beta/ruby-1.9.3-p194/sample/test.rb:1410:in nan_test' not ok float 40 -- C:/msys/1.0/home/beta/ruby-1.9.3-p194/sample/test.rb:1410:in nan_test'
not ok float 45 -- C:/msys/1.0/home/beta/ruby-1.9.3-p194/sample/test.rb:1410:in `nan_test'
not ok/test: 903 failed 7
The optimization flag -Ofast is the root cause of this issue.
Accoring to the manual, -Ofast is same to -O3 and -ffast-math.
And -ffast-math sets -fno-math-errno, -funsafe-math-optimizations, -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and -fcx-limited-range.
The flag -ffinite-math-only means
"Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs."
So the nan test is not worked as expected.
The workaround is adding -fno-finite-math-only in case of -Ofast flag.
This issue was solved with changeset r35497.
ray, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.