<html><body>
<p><font size="2" face="sans-serif">For your requirement, I think our best answer is the -qfloat=nofold option, which stops almost all compile time floating-point constant expression evaluation (except for static initialization). &nbsp;That's overkill but would get the job done. &nbsp;And I should add a qualifier: That doesn't work yet in the new front end used in our new little endian Linux C/C++ compilers, but it will be fixed.</font><br>
<br>
<font size="2" face="sans-serif">I think a better answer is that whenever fenv is used or trapping on floating-point exceptions is used, the compiler should automatically suppress folding either of everything (for fenv) or of specific operations that would lead to an activated exception (for trapping on floating-point exceptions). &nbsp;We have done that in some places, but it's a fairly big job to do everywhere and we have made no commitment to do more. &nbsp;The only cases we've done so far were when an infinity or NaN was generated, not underflow and not inexact.</font><br>
<br>
<font size="2" face="sans-serif">Maybe C should have a standard pragma to set the compile time rounding mode at a lexical block level? &nbsp;Not that I want to try to implement that.</font><br>
<font size="2" face="sans-serif"><br>
- Ian McIntosh &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IBM Canada Lab &nbsp; &nbsp; &nbsp; &nbsp; Compiler Back End Support and Development<br>
</font><br>
<br>
<img width="16" height="16" src="cid:1__=0ABBF765DFF473D88f9e8a93df938@ca.ibm.com" border="0" alt="Inactive hide details for &quot;Fred J. Tydeman&quot; ---2015-02-19 02:32:42 PM---On Thu, 19 Feb 2015 14:01:48 -0500 Ian McIntosh wrote: "><font size="2" color="#424282" face="sans-serif">&quot;Fred J. Tydeman&quot; ---2015-02-19 02:32:42 PM---On Thu, 19 Feb 2015 14:01:48 -0500 Ian McIntosh wrote: &gt;</font><br>
<br>
<font size="1" color="#5F5F5F" face="sans-serif">From:        </font><font size="1" face="sans-serif">&quot;Fred J. Tydeman&quot; &lt;tydeman@tybor.com&gt;</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">To:        </font><font size="1" face="sans-serif">Ian McIntosh/Toronto/IBM@IBMCA</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Cc:        </font><font size="1" face="sans-serif">&quot;cfp-interest@oakapple.net&quot; &lt;cfp-interest@oakapple.net&gt;, &quot;Rajan Bhakta&quot; &lt;rbhakta@us.ibm.com&gt;</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Date:        </font><font size="1" face="sans-serif">2015-02-19 02:32 PM</font><br>
<font size="1" color="#5F5F5F" face="sans-serif">Subject:        </font><font size="1" face="sans-serif">Re: [Cfp-interest] WG14 IEEE 754-C binding meeting minutes        2015/02/18</font><br>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt><font size="2">On Thu, 19 Feb 2015 14:01:48 -0500 Ian McIntosh wrote:<br>
&gt;<br>
&gt;For #3 &quot;Expressions of FP constants done at translation time, yet result is<br>
&gt;inexact, so depends upon rounding mode.&quot;, the IBM POWER XL and z/OS<br>
&gt;compilers have an option -y to control which rounding mode to use for<br>
&gt;expressions evaluated at compile time. &nbsp;Does that meet the requirement?<br>
&gt;<br>
<br>
No, if I read you correctly. &nbsp;I read that as a fixed<br>
static rounding mode to use at translation time.<br>
<br>
I am thinking of different parts of the code running<br>
under different rounding modes. &nbsp;Hence, the same <br>
expression of FP constants evaluates to different values<br>
in different parts of the code.<br>
<br>
---<br>
Fred J. Tydeman &nbsp; &nbsp; &nbsp; &nbsp;Tydeman Consulting<br>
tydeman@tybor.com &nbsp; &nbsp; &nbsp;Testing, numerics, programming<br>
+1 (775) 287-5904 &nbsp; &nbsp; &nbsp;Vice-chair of PL22.11 (ANSI &quot;C&quot;)<br>
Sample C99+FPCE tests: </font></tt><tt><font size="2"><a href="http://www.tybor.com">http://www.tybor.com</a></font></tt><tt><font size="2"><br>
Savers sleep well, investors eat well, spenders work forever.<br>
<br>
</font></tt><br>
</body></html>