Re: Setting -frounding-math by default

2009-03-10 Thread Gabriel Dos Reis
On Tue, Mar 10, 2009 at 12:27 PM, Sylvain Pion wrote: > Other ways might be possible. E.g. avoiding the wrapping if > the associativity concept/axiom is somehow local to the function > and does not leak elsewhere if you provide an Associativity > concept_map for double (or are "scoped concept ma

Re: Setting -frounding-math by default

2009-03-10 Thread Sylvain Pion
Gabriel Dos Reis wrote: On Tue, Mar 10, 2009 at 10:41 AM, Sylvain Pion wrote: Richard Guenther wrote: The middle-end knows about an explicit association barrier (only used from the Fortran FE sofar), a PAREN_EXPR. Would exposing that to C/C++ be of any help? For example it would, even with -

Re: Setting -frounding-math by default

2009-03-10 Thread Sylvain Pion
Andrew Haley wrote: We know that's what you want. What we don't know (well, what I don't know) is *why*. If you want to do something as specialized as interval arithmetic, what's the big deal with having to pass special flags to the compiler? I contest the "as specialized as" comment. I know

Re: Setting -frounding-math by default

2009-03-10 Thread Gabriel Dos Reis
On Tue, Mar 10, 2009 at 10:41 AM, Sylvain Pion wrote: > Richard Guenther wrote: >> >> The middle-end knows about an explicit association barrier (only >> used from the Fortran FE sofar), a PAREN_EXPR. Would exposing >> that to C/C++ be of any help? For example it would, even with >> -ffast-math,

Re: Setting -frounding-math by default

2009-03-10 Thread Gabriel Dos Reis
On Tue, Mar 10, 2009 at 10:31 AM, Sylvain Pion wrote: [...] > If you are looking for the Right [tm] solution, please take a look at N2811. I'm familiar with that paper -- I should have made that disclosure in my previous message. -- Gaby

Re: Setting -frounding-math by default

2009-03-10 Thread Andrew Haley
Sylvain Pion wrote: > Joseph S. Myers wrote: >> On Mon, 9 Mar 2009, Sylvain Pion wrote: >> >>> Later, 1) started to be taken care of, and it was unfortunately >>> added under the control of the same -frounding-math option. >>> Which now, makes it harder to come back, since we want different >>> def

Re: Setting -frounding-math by default

2009-03-10 Thread Sylvain Pion
Richard Guenther wrote: The middle-end knows about an explicit association barrier (only used from the Fortran FE sofar), a PAREN_EXPR. Would exposing that to C/C++ be of any help? For example it would, even with -ffast-math, avoid constant folding for (x + FLT_EPS) - FLT_EPS (which FLT_EPS suc

Re: Setting -frounding-math by default

2009-03-10 Thread Sylvain Pion
Gabriel Dos Reis wrote: On Tue, Mar 10, 2009 at 9:45 AM, Sylvain Pion wrote: - Show quoted text - Joseph S. Myers wrote: On Mon, 9 Mar 2009, Sylvain Pion wrote: Later, 1) started to be taken care of, and it was unfortunately added under the control of the same -frounding-math option. Which n

Re: Setting -frounding-math by default

2009-03-10 Thread Gabriel Dos Reis
On Tue, Mar 10, 2009 at 9:45 AM, Sylvain Pion wrote: > - Show quoted text - > Joseph S. Myers wrote: >> >> On Mon, 9 Mar 2009, Sylvain Pion wrote: >> >>> Later, 1) started to be taken care of, and it was unfortunately >>> added under the control of the same -frounding-math option. >>> Which now, m

Re: Setting -frounding-math by default

2009-03-10 Thread Richard Guenther
On Tue, Mar 10, 2009 at 4:45 PM, Sylvain Pion wrote: > - Show quoted text - > Joseph S. Myers wrote: >> >> On Mon, 9 Mar 2009, Sylvain Pion wrote: >> >>> Later, 1) started to be taken care of, and it was unfortunately >>> added under the control of the same -frounding-math option. >>> Which now, m

Re: Setting -frounding-math by default

2009-03-10 Thread Sylvain Pion
Joseph S. Myers wrote: On Mon, 9 Mar 2009, Sylvain Pion wrote: Later, 1) started to be taken care of, and it was unfortunately added under the control of the same -frounding-math option. Which now, makes it harder to come back, since we want different defaults for these two aspects. I have alr

Re: Setting -frounding-math by default

2009-03-09 Thread Joseph S. Myers
On Mon, 9 Mar 2009, Sylvain Pion wrote: > Later, 1) started to be taken care of, and it was unfortunately > added under the control of the same -frounding-math option. > Which now, makes it harder to come back, since we want different > defaults for these two aspects. > > I have already mentioned

Re: Setting -frounding-math by default

2009-03-09 Thread Joseph S. Myers
On Mon, 9 Mar 2009, Sylvain Pion wrote: > - C++ does not have it, so what's the plan for C++ ? That's for C++ maintainers, possibly guided by anything that goes in the C++ standard. The pragma syntax is a fairly small part of the work, as would be control of the options at a per-function level

Re: Setting -frounding-math by default

2009-03-09 Thread Paolo Bonzini
>> I think 2) is taken care of by -fassociative-math, or it should at least. > > I don't think it is (I haven't checked), and I don't see why it should. > This transformation has nothing to do with associativity : unless I'm > mistaken, it is always valid when rounding is to the nearest or towards

Re: Setting -frounding-math by default

2009-03-09 Thread Sylvain Pion
Paolo Bonzini wrote: Sylvain Pion wrote: Andrew Thomas Pinski wrote: The fact is that Roger's patch introduced a regression (this word should be clear enough here), in that some users now have their old code broken, and they are forced to add the -frounding-math option (after having lost some t

Re: Setting -frounding-math by default

2009-03-09 Thread Sylvain Pion
Joseph S. Myers wrote: On Sun, 8 Mar 2009, Sylvain Pion wrote: this pragma. I nevertheless try to find grants for funding people to implement some related things in GCC. And I also contribute time to help in the guidance of GCC with my expertise in this particular area, even if it requires a

Re: Setting -frounding-math by default

2009-03-09 Thread Paolo Bonzini
Sylvain Pion wrote: > Andrew Thomas Pinski wrote: >>> The fact is that Roger's patch introduced a regression (this word >>> should be clear enough here), in that some users now have their old >>> code broken, and they are forced to add the -frounding-math option >>> (after having lost some time fin

Re: Setting -frounding-math by default

2009-03-09 Thread Sylvain Pion
Andrew Thomas Pinski wrote: The fact is that Roger's patch introduced a regression (this word should be clear enough here), in that some users now have their old code broken, and they are forced to add the -frounding-math option (after having lost some time finding about this non trivial issue).

Re: Setting -frounding-math by default

2009-03-09 Thread Richard Guenther
On Mon, Mar 9, 2009 at 12:35 AM, Joseph S. Myers wrote: > - Show quoted text - > On Mon, 9 Mar 2009, Steven Bosscher wrote: > >> On Mon, Mar 9, 2009 at 12:24 AM, Joseph S. Myers >> wrote: >> >  The defaults are deliberate decisions >> > (and as such the adoption of those decisions cannot meaningf

Re: Setting -frounding-math by default

2009-03-08 Thread Joseph S. Myers
On Sun, 8 Mar 2009, Richard Guenther wrote: > We try to have a sensible default setting that doesn't prevent constant > folding (which -frounding-math does). -ftrapping-math implemented according to its specification would prevent a lot of constant folding (at least, the "inexact" and other exc

Re: Setting -frounding-math by default

2009-03-08 Thread Joseph S. Myers
On Mon, 9 Mar 2009, Steven Bosscher wrote: > On Mon, Mar 9, 2009 at 12:24 AM, Joseph S. Myers > wrote: > >  The defaults are deliberate decisions > > (and as such the adoption of those decisions cannot meaningfully be > > considered a regression: it's not a bug but a feature), but are more > > li

Re: Setting -frounding-math by default

2009-03-08 Thread Steven Bosscher
On Mon, Mar 9, 2009 at 12:24 AM, Joseph S. Myers wrote: >  The defaults are deliberate decisions > (and as such the adoption of those decisions cannot meaningfully be > considered a regression: it's not a bug but a feature), but are more > likely to change in the other direction from what you want

Re: Setting -frounding-math by default

2009-03-08 Thread Joseph S. Myers
On Sun, 8 Mar 2009, Sylvain Pion wrote: > this pragma. I nevertheless try to find grants for funding > people to implement some related things in GCC. And I also > contribute time to help in the guidance of GCC with my > expertise in this particular area, even if it requires a lot > of time to c

Re: Setting -frounding-math by default

2009-03-08 Thread Andrew Thomas Pinski
Sent from my iPhone On Mar 8, 2009, at 3:26 PM, Sylvain Pion wrote: Joseph S. Myers a écrit : On Sun, 8 Mar 2009, Sylvain Pion wrote: http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00104.html introduced the -frounding-math option, and changed the default behavior of GCC to optimize "unsaf

Re: Setting -frounding-math by default

2009-03-08 Thread Richard Guenther
On Sun, Mar 8, 2009 at 11:26 PM, Sylvain Pion wrote: > Joseph S. Myers a écrit : >> >> On Sun, 8 Mar 2009, Sylvain Pion wrote: >> >>> http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00104.html >>> introduced the -frounding-math option, and changed >>> the default behavior of GCC to optimize "unsafely

Re: Setting -frounding-math by default

2009-03-08 Thread Sylvain Pion
Joseph S. Myers a écrit : On Sun, 8 Mar 2009, Sylvain Pion wrote: http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00104.html introduced the -frounding-math option, and changed the default behavior of GCC to optimize "unsafely". That is a misleading description. The cautionary text added by that

Re: Setting -frounding-math by default

2009-03-08 Thread Joseph S. Myers
On Sun, 8 Mar 2009, Sylvain Pion wrote: > http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00104.html > introduced the -frounding-math option, and changed > the default behavior of GCC to optimize "unsafely". That is a misleading description. The cautionary text added by that patch is still present

Setting -frounding-math by default

2009-03-08 Thread Sylvain Pion
I would like to argue that the default behavior should be -frounding-math, which is safer than the opposite used currently. Back in 2003, the following patch by Roger Sayle : http://gcc.gnu.org/ml/gcc-patches/2003-09/msg00104.html introduced the -frounding-math option, and changed the default beh