www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/18/05:17:56

Date: Tue, 18 Apr 2000 11:17:38 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp AT delorie DOT com
Subject: Re: inefficiency of GCC output code & -O problem
In-Reply-To: <38FB7858.41B090DB@mtu-net.ru>
Message-ID: <Pine.SUN.3.91.1000418111715.28255H-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 18 Apr 2000, Alexei A. Frounze wrote:

> > Where gcc produces considerably less efficient code, is when you have
> > 
> >   int i;
> >   double a, b;
> > 
> >   i = (int)(a*b);
> > 
> > Here, gcc always needs to save and restore the FPU control word, and
> > there are a few occurences of this type in Alexei's code. (I don't
> > blame gcc here, I think it is almost impossible to do much better
> > for a compiler.)
> 
> Stupid thing. It doesn't have to save/load the state of FPU.

I thought you were already cured of that ``stupid GCC'' attitude ;-).

In fact, GCC has very good reasons to do this save/restore control
word thing, because the compiler has no other way to ensure that
rounding is done according to what the various standards supported by
GCC say.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019