title: Is this floating-point optimization allowed?
body: <p>I tried to check out where <code>float</code> loses the ability to exactly represent large integer numbers. So I wrote this little snippet:</p>
  
  <pre><code>int main() {
      for (int i=0; ; i++) {
          if ((float)i!=i) {
              return i;
          }
      }
  }
  </code></pre>
  
  <p>This code seems to work with all compilers, except clang. Clang generates a simple infinite loop. <a href="https://godbolt.org/z/ck_uVe" rel="noreferrer">Godbolt</a>.</p>
  
  <p>Is this allowed? If yes, is it a QoI issue?</p>