<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri" size="2"><span style="font-size:10pt;">
<div>I'm using a new version of Clang from Apple, targeting macOS 10.12, which comes from an Xcode that is still in beta. I'm compiling C code, rather than C++. </div>
<div><font size="2"><span style="font-size:11pt;"> </span></font></div>
<div>I'm hitting problems with the compiler assuming that floating-point divides won’t trap, and executing them speculatively, in advance of the conditions that prevent the traps going off. Previous versions of Clang didn’t do this, but it's causing me difficulties,
because the product I work on is tested with Overflow, Invalid and Divide-by-zero traps enabled: this makes it much easier to find problems than by tracing back through lots of NaNs. </div>
<div><font size="2"><span style="font-size:11pt;"> </span></font></div>
<div>I can’t find anything that seems relevant in the Clang user's manual at <a href="http://clang.llvm.org/docs/UsersManual.html"><font color="blue"><u>http://clang.llvm.org/docs/UsersManual.html</u></font></a>.</div>
<div> </div>
<div>The GCC 4.2 documentation has three options that look possibly relevant. -ftrapping-math and -fnon-call-exceptions are accepted by Clang, but don’t seem to make any difference to the problematic source; -fsignaling-nans is not supported by Clang, and the
message is quite clear about that. </div>
<div><font size="2"><span style="font-size:11pt;"> </span></font></div>
<div>Turning optimisation right off with -O0 suppresses the problem, but is really bad for performance: we've been able to build and work effectively at -O2 for several years with Apple's Clang releases. </div>
<div> </div>
<div>Am I missing an option somewhere, or does this look like a bug that I need to report? </div>
<div> </div>
<div>thanks,</div>
<div><font size="2"><span style="font-size:11pt;"> </span></font></div>
<div>-- </div>
<div>John Dallman</div>
<div><font size="2"><span style="font-size:11pt;"> </span></font></div>
<div><font face="Arial" size="3"><span style="font-size:12pt;">-----------------<br>

Siemens Industry Software Limited is a limited company registered in England and Wales.<br>

Registered number: 3476850.<br>

Registered office: Faraday House, Sir William Siemens Square, Frimley, Surrey, GU16 8QD. </span></font></div>
</span></font>
</body>
</html>