Re: Compile-time floating-point expressions and subsequent detection of possible overflows etc -- during the compile-time stage.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011-11-03 00:36:20 +1100, leon zadorin wrote:
> I dont think that this is the point i am making... Gcc allows certain
> optimization options eg -Ofast (4.6) where -ffast-math (even prior to
> 4.6), and some other, unsafe wrt pedantic standard definitions,
> optimization options become available (including, i think
> floating-point constant folding opportunities).
> 
> I am very happy with such options by the way so the question was not
> about standard compliance (hence my original statement about the said
> compile-time calculations being done under certain conditions, not all
> the time and having nothing to do with c++03/11 standard
> specifications).
> 
> I am saying that having such, great, otimization options available it
> would be super-helpful if there was a way to have a diagnostic/warning
> about compile-time calculations producing non-finite floating point
> values (whether via lib mpfr or otherwise).

I'd say that this wouldn't be much useful, because similar problems
can also occur at run time, and if you use options like -ffast-math,
you won't be able to tell whether your program works correctly...
unless you can prove that no overflows (etc.) can occur. But if you
can do that, you no longer need GCC to do this for you for the
particular case of compile-time calculations.

-- 
Vincent Lefèvre <vincent@xxxxxxxxxx> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Arénaire project (LIP, ENS-Lyon)


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux