<div dir="ltr">LLVM believes that floating point division will never trap, and speculates it to make code like this:<div>float tmp = 1.0 / scale;</div><div>scale = scale == 0.0 ? scale : tmp;</div><div><br></div><div>Normally, FP division produces NaN. The only way that I'm aware of to make FP div trap is to use fenv.h, which isn't supported:</div><div><a href="https://llvm.org/bugs/show_bug.cgi?id=8100">https://llvm.org/bugs/show_bug.cgi?id=8100</a><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 18, 2015 at 2:15 AM, Shriramana Sharma via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello. I'm using Clang 3.7~svn251177-1~exp1 from the Apt repo on<br>
Kubuntu Trusty 64 bit. I'm trying to backport Asymptote from Debian<br>
Sid: <a href="https://packages.debian.org/sid/asymptote" rel="noreferrer" target="_blank">https://packages.debian.org/sid/asymptote</a><br>
<br>
I find that the build fails with:<br>
<br>
../asy -dir ../base -config "" -render=0 -f pdf -noprc filegraph.asy<br>
../base/plain_Label.asy: 294.10: runtime: Floating point exception (core dumped)<br>
<br>
When I investigated this I found that there was no problem when<br>
compiling with GCC.<br>
<br>
Please note the attached script which should demonstrate the error.<br>
Running the script with -g will compile using the "default" compiler<br>
(gcc) and does not produce any error.<br>
<br>
I used KDbg to debug the situation i.e. run the executable asy with<br>
the given arguments which produced the error during the build and<br>
found that at pair.h, line 148 reads:<br>
<br>
if(scale != 0.0) scale=1.0/scale;<br>
<br>
but it is at this point that despite the if() check, during one<br>
particular invocation to pair unit(const pair&), somehow the program<br>
is trying to do the division and getting the error.<br>
<br>
Note that for some reason during debugging I keep getting SIGPWR,<br>
SIGXCPU etc – I don't know why this is but it is perhaps because asy<br>
implements a virtual machine which does not support debugging or such?<br>
Anyhow, repeatedly trying to run the executable with the given<br>
arguments produces the error in the end.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा<br>
</font></span><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>