From: Jeff Sullivan <jps@zk3.dec.com>
Subject: Re: DecC vs. gcc-2.8.1, why is the difference in speed so large?
Date: 1999/06/08 [thread overview]
Message-ID: <375D5250.9EF97EF7@zk3.dec.com> (raw)
In-Reply-To: 7jjcs4$kvg@ds2.acs.ucalgary.ca
Serguei Patchkovskii wrote:
> Your benchmark is meaningless, as the entire inner loop computing 'x'
> can be eliminated after simple local analysis of the do_that() subroutine.
> gcc deliberately refrains from performing loop elimination in such cases,
> as this can result in unexpected results for programs relying on loops for
> delays (which is a bad idea in any case - but that had never stopped anyone).
> DEC cc apparently removes your inner loop at the default optimization level,
> which can easily explain a factor of 50 difference in the timing.
Yes, this is true. The original test case that was posted also
contained this in main():
do_that; /* instead of do_that(&some_int);
which is not actually a function call and even more meaningless.
There are many test cases and "real world" code that will demostrate
the improved optimizations provided by Compaq C (formerly DEC C), but
this case is not a very good (or fair) example.
For developers interested in an even more advanced compiler for
UNIX V4.0D and later, you might take a look at the Developer's
Toolkit for Tru64 UNIX.
See http://www.unix.digital.com/developerstoolkit/
-Jeff
--
Jeff Sullivan | Compaq Computer Corp | mailto:jps@zk3.dec.com
Compaq C/C++ | Nashua, NH ZK3-2X23 | Jeff.Sullivan@compaq.com
prev parent reply other threads:[~1999-06-08 4:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-06-04 4:00 DecC vs. gcc-2.8.1, why is the difference in speed so large? Christoph Walti
1999-06-04 4:00 ` David T. Blake
1999-06-08 4:00 ` Jeff Sullivan
1999-06-07 4:00 ` Mark Gelinas
1999-06-08 4:00 ` Serguei Patchkovskii
1999-06-08 4:00 ` Jeff Sullivan [this message]
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox