math: adjust compilation flags, use them when testing

We were using special compilation flags for the math package, but we
weren't using them when testing.  That meant that our tests were not
checking the real code we were providing.  Fix that.

Fixing that revealed that we were not using a good set of flags, or at
least were not using flags that let the tests pass.  Adjust the flags
to stop using -funsafe-math-optimizations on x86.  Instead always use
-ffp-contract=off -fno-math-errno -fno-trapping-math for all targets.

Fixes golang/go#23647

Change-Id: If9a80f99c61fe34d966aa1bf0d554e65cb54e8ee
Reviewed-on: https://go-review.googlesource.com/91355
Reviewed-by: Than McIntosh <thanm@google.com>
5 files changed