<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - FMF.isFast() returns incorrect result when FMF==0x7f"
   href="https://bugs.llvm.org/show_bug.cgi?id=49896">49896</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>FMF.isFast() returns incorrect result when FMF==0x7f
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>melanie.blower@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I want to check whether the IR Builder FMF flags are set to isFast() in
clang/codegen

I have a test case that selects all the FMF flags on the cc1 command line,

I tried to write this code:
     auto FMF = Builder.getFastMathFlags();
     if (FMF.isFast())

but that didn't work, I had to write like this:
    if (FMF.allowReassoc() && FMF.noNaNs() && FMF.noInfs() &&
        FMF.noSignedZeros() && FMF.allowReciprocal() && FMF.allowContract() &&
        FMF.approxFunc())

That's because the implementation of isFast ultimately checks, in llvm
Operator.h, if the byte == ~0

OK to rewrite that check as byte == 0x7f?  I read a comment that the bits in
the struct are all used up, there's no 8th bit available at this time.

I don't have an easy reproducer, the patch I'm working on is
<a href="https://reviews.llvm.org/D100118">https://reviews.llvm.org/D100118</a> ; the line where I had to check each bits is
CGBuiltin.cpp:3829 in that patch. If I change it to isFast() then the first run
line in the test case fails, clang/test/CodeGen/arithmetic-fence-builtin.c</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>