[Top] [All Lists]

RE: Error in gcc version 2.96 20000731

To: Kjeld Borch Egevang <>
Subject: RE: Error in gcc version 2.96 20000731
From: "Maciej W. Rozycki" <>
Date: Fri, 14 Sep 2001 16:42:46 +0200 (MET DST)
In-reply-to: <>
Organization: Technical University of Gdansk
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:, PGP key available        +

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