aarch64: Fix inverted approx_sqrt condition
authorRichard Sandiford <richard.sandiford@arm.com>
Thu, 20 Feb 2020 14:16:12 +0000 (14:16 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Fri, 21 Feb 2020 10:17:27 +0000 (10:17 +0000)
The fix for PR80530 included an accidental flipping of the
flag_finite_math_only check, so that -ffinite-math-only (and thus
-ffast-math) disabled approximate sqrt rather than enabling it.

This is tested by later patches but seemed worth splitting out.

2020-02-21  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
* config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Fix inverted
flag_finite_math_only condition.

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index 15ce49c8c877167cb048e382c28b3052e72e54dd..16a23d009447702e3898604902c78037bd384d69 100644 (file)
@@ -1,3 +1,8 @@
+2020-02-21  Richard Sandiford  <richard.sandiford@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_emit_approx_sqrt): Fix inverted
+       flag_finite_math_only condition.
+
 2020-02-20  Uroš Bizjak  <ubizjak@gmail.com>
 
        PR target/93828
index 4a34dce5d7963ae00c77aa623c7911363a0c2acd..6fb567ae4bfd6efe6fc0eb97e754735bfe77e8b7 100644 (file)
@@ -12761,7 +12761,7 @@ aarch64_emit_approx_sqrt (rtx dst, rtx src, bool recp)
                & AARCH64_APPROX_MODE (mode))))
        return false;
 
-      if (flag_finite_math_only
+      if (!flag_finite_math_only
          || flag_trapping_math
          || !flag_unsafe_math_optimizations
          || optimize_function_for_size_p (cfun))