Date: Tue, 18 Apr 2000 11:17:38 +0200 (IST) From: Eli Zaretskii 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: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk 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.