linux-mips
[Top] [All Lists]

RE: Error in gcc version 2.96 20000731

To: Kjeld Borch Egevang <kjelde@mips.com>
Subject: RE: Error in gcc version 2.96 20000731
From: "Maciej W. Rozycki" <macro@ds2.pg.gda.pl>
Date: Fri, 14 Sep 2001 16:42:46 +0200 (MET DST)
Cc: linux-mips@oss.sgi.com
In-reply-to: <NFBBKGGKGLLGNBGCEPKIAEHDCAAA.kjelde@mips.com>
Organization: Technical University of Gdansk
Sender: owner-linux-mips@oss.sgi.com
On Thu, 13 Sep 2001, Kjeld Borch Egevang wrote:

> I was trying to port SPEC CPU 2000 (benchmarks), and one of the tests
> failed. I boiled it down to the attached program. For performance reasons it
> could be perfectly valid not to use memset(), but I agree that the code
> looks a bit odd.

 With a high optimization level and a constant size of the area to set
(you'd likely use sizeof here, which is constant) gcc will happily inline
a memset() yielding no worse performance but no bugs and better
readability.  You may have no loop at all as the result.  Check yourself! 

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +


<Prev in Thread] Current Thread [Next in Thread>