--0-2076963316-1123574270=:75895
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

let me get it stright...
 
you would say that you expect problems when mixing -ffast-math with -O9 and 
optimization?
 
I have huge project (video encoder/decoder) that uses -ffast-math -O9 
-mtune=prescott and some more switches all compiled with gcc 3.2 (Suse 9.1 with 
-march instead mtune)
gcc 3.4 (FC3) and gcc 4.0 (FC4) running perfectly with no errors for quite a 
long while!
 
ciao
scipio  

Oleg Goldshmidt <[EMAIL PROTECTED]> wrote:
Shachar Shemesh 
writes:

> Actually, something extremely weird it going on here. The result
> change, considerably, when I compile with or without "no-math-errno":



> > [EMAIL PROTECTED]:/tmp$ gcc -O2 -fno-math-errno -o test -lm test.c && time 
> > ./test
> > nan
> >
> > real 0m7.521s
> > user 0m7.517s
> > sys 0m0.003s
> 
> Why did the answer turn into "nan"?
> 
> Shachar

Because when you mix no-math-errno with optimization you may break the
proper IEEE spec for math functions. It's right there in gcc docs. The
more common case is when you switch fast-math on (which is
no-math-errno and a few other options bundled together).

Don't ask me why the options exist: I will say that all errors should
be checked. I suspect that there are architectures (Motorolas) that
have lots of special math functions, including sqrt, sin, cos, etc
implemented as single instructions, and the fast-math options exist
for those.

-- 
Oleg Goldshmidt | [EMAIL PROTECTED] | http://www.goldshmidt.org

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
--0-2076963316-1123574270=:75895
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<DIV>let me get it stright...</DIV>
<DIV>&nbsp;</DIV>
<DIV>you would say that you expect problems when mixing -ffast-math with -O9 
and optimization?</DIV>
<DIV>&nbsp;</DIV>
<DIV>I have huge project (video encoder/decoder) that uses -ffast-math -O9 
-mtune=prescott and some more switches all compiled with&nbsp;gcc 3.2 (Suse 9.1 
with -march instead mtune)</DIV>
<DIV>gcc&nbsp;3.4 (FC3) and&nbsp;gcc 4.0&nbsp;(FC4) running perfectly with no 
errors for quite a long while!</DIV>
<DIV>&nbsp;</DIV>
<DIV>ciao</DIV>
<DIV>scipio&nbsp;&nbsp;<BR><BR><B><I>Oleg Goldshmidt &lt;[EMAIL 
PROTECTED]&gt;</I></B> wrote:</DIV>
<BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; 
BORDER-LEFT: #1010ff 2px solid">Shachar Shemesh <[EMAIL 
PROTECTED]>writes:<BR><BR>&gt; Actually, something extremely weird it going on 
here. The result<BR>&gt; change, considerably, when I compile with or without 
"no-math-errno":<BR><BR><SNIP><BR><BR>&gt; &gt; [EMAIL PROTECTED]:/tmp$ gcc -O2 
-fno-math-errno -o test -lm test.c &amp;&amp; time ./test<BR>&gt; &gt; 
nan<BR>&gt; &gt;<BR>&gt; &gt; real 0m7.521s<BR>&gt; &gt; user 0m7.517s<BR>&gt; 
&gt; sys 0m0.003s<BR>&gt; <BR>&gt; Why did the answer turn into "nan"?<BR>&gt; 
<BR>&gt; Shachar<BR><BR>Because when you mix no-math-errno with optimization 
you may break the<BR>proper IEEE spec for math functions. It's right there in 
gcc docs. The<BR>more common case is when you switch fast-math on (which 
is<BR>no-math-errno and a few other options bundled together).<BR><BR>Don't ask 
me why the options exist: I will say that all errors should<BR>be checked. I 
suspect that there are
 architectures (Motorolas) that<BR>have lots of special math functions, 
including sqrt, sin, cos, etc<BR>implemented as single instructions, and the 
fast-math options exist<BR>for those.<BR><BR>-- <BR>Oleg Goldshmidt | [EMAIL 
PROTECTED] | 
http://www.goldshmidt.org<BR><BR>=================================================================<BR>To
 unsubscribe, send mail to [EMAIL PROTECTED] with<BR>the word "unsubscribe" in 
the message body, e.g., run the command<BR>echo unsubscribe | mail [EMAIL 
PROTECTED]<BR><BR></BLOCKQUOTE><p>__________________________________________________<br>Do
 You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around 
<br>http://mail.yahoo.com 
--0-2076963316-1123574270=:75895--

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to