This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC beaten by ICC in stupid trig test!


[ Apologies,  I've been reading diagonally through the mails; many
  messages contain  inaccuracies and misleading statements.  I'm
  responding to Joe's message, not because it is such message but
  because it contains what I wanted to point to. ]


Joe Buck <Joe.Buck@synopsys.com> writes:

| On Mar 24, 2004, at 1:51 PM, Joe Buck wrote:
| > > And no, I'm not being pedantic; in many scientific apps, the programmer
| > > is aware of the expected range of values the variables will have, and
| > > will deliberately arrange the operations so that variables of similar
| > > magnitudes are combined.
| 
| On Wed, Mar 24, 2004 at 01:56:16PM -0500, Bradley Lucier wrote:
| > I'm aware of the usual examples.  Do you think that we need yet another 
| > fast-math flag to allow the compiler to reassociate values in 
| > floating-point arithmetic? -freally-unsafe-math-optimizations perhaps?  
| > Or maybe such a programmer as you describe will just turn off 
| > -funsafe-math-optimizations.
| 
| No.  Why would we need such a thing?  If the user does not care about
| order of evaluation, the user can write a+b+c .  As someone said, right
| now we can't tell the difference between a+b+c;

But we should.  The FORTRAN standard gives some liberties about the
re-association that some languages don't.  For example, in C++
a+b+c means (a+b)+c whether the parenthesis is there or not.
The C++ standard is clear on that.
We should be very careful about that fact.  I semi-joked previously
about -ffast-math but now I'm seeing that some messages in this thread
(not yours, Joe!) don't quite get it.

-- gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]