<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span> changed
          <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - ARM isnormal(long double NaN) raises invalid"
   href="https://bugs.llvm.org/show_bug.cgi?id=46811">bug 46811</a>
          <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Resolution</td>
           <td>---
           </td>
           <td>DUPLICATE
           </td>
         </tr>

         <tr>
           <td style="text-align:right;">Status</td>
           <td>NEW
           </td>
           <td>RESOLVED
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - ARM isnormal(long double NaN) raises invalid"
   href="https://bugs.llvm.org/show_bug.cgi?id=46811#c3">Comment # 3</a>
              on <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED DUPLICATE - ARM isnormal(long double NaN) raises invalid"
   href="https://bugs.llvm.org/show_bug.cgi?id=46811">bug 46811</a>
              from <span class="vcard"><a class="email" href="mailto:richard-llvm@metafoo.co.uk" title="Richard Smith <richard-llvm@metafoo.co.uk>"> <span class="fn">Richard Smith</span></a>
</span></b>
        <pre>OK, I see the same thing if I use __builtin_isnormal instead:
<a href="https://godbolt.org/z/37M8PG">https://godbolt.org/z/37M8PG</a> -- in particular, the `fcmp`s we generate can set
FE_INVALID on NaN.

On x86_64, those `fcmp`s are replaced by constrained FP intrinsics:
<a href="https://godbolt.org/z/GK9Ejh">https://godbolt.org/z/GK9Ejh</a>

So this is another duplicate of 46799: this code was compiled assuming the
default floating point environment and that FP exceptions would not be
inspected. Use of <fenv.h> facilities from that environment is undefined, and
in this case that's manifesting as isnormal setting a floating point exception.

*** This bug has been marked as a duplicate of <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - no support for FENV_ACCESS on armv8"
   href="show_bug.cgi?id=46799">bug 46799</a> ***</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>