<html><body>
<p><font size="2" face="sans-serif">I agree that the new pragmas we're discussing should apply to compound statements (C lexical blocks). There are sometimes complications.</font><br>
<br>
<br>
<font size="2" face="sans-serif">Straightforward:</font>
<ul style="padding-left: 18pt"><font size="2" face="sans-serif">{</font><br>
<font size="2" face="sans-serif"> #pragma STDC FENV_ROUND FE_TOWARD_ZERO</font><br>
<font size="2" face="sans-serif"> . . .</font><br>
<font size="2" face="sans-serif">} /* pragma's effect ends here */</font></ul>
<br>
<br>
<font size="2" face="sans-serif">A little trickier:</font>
<ul style="padding-left: 18pt"><font size="2" face="sans-serif">{</font><br>
<font size="2" face="sans-serif"> #pragma STDC FENV_ROUND FE_TOWARD_ZERO</font><br>
<font size="2" face="sans-serif"> . . .</font><br>
<font size="2" face="sans-serif"> if (condition) goto label1; /* pragma's effect ends if the goto is executed */</font><br>
<font size="2" face="sans-serif"> . . .</font><br>
<font size="2" face="sans-serif">} /* pragma's effect ends here */</font><br>
<font size="2" face="sans-serif">. . .</font><br>
<font size="2" face="sans-serif">label1:</font></ul>
<br>
<font size="2" face="sans-serif">In that case the compiler has to observe that Label1 is outside the compound statement affected by the pragma, and turn off the pragma's effect both when exiting through the bottom of the compound statement and also when exiting in the middle via a goto or equivalent.</font><br>
<br>
<br>
<font size="2" face="sans-serif">A lot trickier, using gcc / IBM xlc label variables:</font>
<ul style="padding-left: 18pt"><font size="2" face="sans-serif">void* label_variable;</font><br>
<font size="2" face="sans-serif">{</font><br>
<font size="2" face="sans-serif"> #pragma STDC FENV_ROUND FE_TOWARD_ZERO</font><br>
<font size="2" face="sans-serif"> . . .</font><br>
<font size="2" face="sans-serif"> if (condition) label_variable = label2;</font><br>
<font size="2" face="sans-serif"> else label_variable = label3;</font><br>
<font size="2" face="sans-serif"> . . .</font><br>
<font size="2" face="sans-serif"> if (condition) goto label_variable; /* pragma's effect MIGHT OR MIGHT NOT end if the goto is executed, depending on where it goes to */</font><br>
<font size="2" face="sans-serif"> . . .</font><br>
<font size="2" face="sans-serif"> label2: /* if label_variable points here, goto leaves the pragma in effect */</font><br>
<font size="2" face="sans-serif"> . . .</font><br>
<font size="2" face="sans-serif">} /* pragma's effect ends here */</font><br>
<font size="2" face="sans-serif">. . .</font><br>
<font size="2" face="sans-serif">label3: /* if label_variable points here, goto ends the pragma's effect */</font><br>
</ul>
<font size="2" face="sans-serif">- Ian McIntosh IBM Canada Lab Compiler Back End Support and Development<br>
</font></body></html>