surprising optimization results

Mike Stump mrs@wrs.com
Mon Aug 16 10:42:00 GMT 1999


> Date: Sun, 15 Aug 1999 00:46:08 -0700
> From: Paul Burchard <burchard@pobox.com>

> Inlines which call and return by value (even struct value) are
> showing up consistently faster in my tests than the equivalent
> inlines which call and return using non-const reference args (gcc
> configuration below).  Assuming this is a real effect, it is
> surprising to me -- but perhaps not to those more familiar with
> gcc's optimization strategies (maybe by-value makes alias analysis
> easier?).

:-) Predictable.  Glad you noticed the cool codegen strategies in the
compiler.  I think the one you are observing are the results of
ADDRESSOF.  References kill a bit of optimizability, though the limits
of what the compiler can and can't do are pushed farther out every now
and then.


More information about the Gcc mailing list