[llvm-bugs] [Bug 43725] New: Bad floating-point "optimizations"

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Oct 19 19:15:44 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=43725

            Bug ID: 43725
           Summary: Bad floating-point "optimizations"
           Product: clang
           Version: 8.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: unassignedclangbugs at nondot.org
          Reporter: tydeman at tybor.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Is there a way to disable ALL "optimizations" related to floating-point?
My testing has shown that clang does the following:
  1. * x  => x
  0. * x  => 0.
  x / 1.  => x
  x / x   => 1.
  0. / x  => 0.
  x + 0.  => x
  x - 0.  => x
  x - x   => 0.
They are all invalid "optimizations" if x is a signaling NaN.
In addition, some are invalid if x is a signed zero or infinity.
In the above, 'x' can be either a variable or a constant.
It might matter if 'x' is float, double, or long double.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20191020/1f042936/attachment.html>


More information about the llvm-bugs mailing list