Re: gcc compiler option -Ofast used when compiling Ruby implementation (using C code) maybe gives bugs?
"Frank J. Cameron" <[email protected]> Tue, 5 Nov 2019 21:33:33 -0500
| Newsgroups | gmane.comp.lang.ruby.general |
|---|---|
| Message-ID | <3c94da32248b16d5211fdc8061ff6180.squirrel@squirrelmail.tuffmail.net> |
Colin Bartlett wrote: > I've been looking at ways of making the Date class faster, mostly > by replacing its use of floating point arithmetic by faster integer > arithmetic, but also in some cases by changing the algorithms. Cool :-) > On each platform I tried using different optimization options. Using > -O0, -O1, -O2, -O3, -Og, -Os the results were the same for the current > Date C functions and my versions. > > But when I used -Ofast then for some functions I was getting different > results from the current Date C functions and my versions. That could be normal for -Ofast: -Ofast: Disregard strict standards compliance... also enables optimizations that are not valid for all standard-compliant programs... turns on -ffast-math. -ffast-math: ... can result in incorrect output for programs that depend on an exact implementation... It may, however, yield faster code for programs that do not require the guarantees of these specifications. Unsubscribe: <mailto:[email protected]?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>