This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc 3.0.1 & C++ ABI issues


Jason Merrill <jason_merrill@redhat.com> writes:

| IMO, optimizing this case is not important anyway; who passes complex
| objects by value?

Numericists :-)  (Note also that B. Stroustrup in TC++PL3 encourages
passing by value object of concrete classes such as complex<>).
Passing "small" objects such as complex<> by value is seen to be
superior to passing by const reference.

Sometime ago, Kent Budge et al. made an interesting measurement
published in the Journal of C Language Translation (December 1994)

    "Management of Class Temporaries in C++ Translation System"
    Kent Budge, James Peery, Allen Robinson and Michael Wong

Stan Lippamn (Inside  The C++ Model Object) commented:

    The paper analyzes the generated assembly and shows that the cause
    of the performance degradation is the large number of program
    stack access to read and write the individual class members.  By
    disaggregating the class and moving the individual members into
    registers, they were able to achieve nearly doubled performance.
    [...]
    There already exist some optimizers, I'm told, that do put pieces
    of temporary classes into registers.  As compiler implementations
    shift their focus from language feature support (with the
    completion of Standard C++) to quality of implementation issues,
    optimizations such as disaggretation should become commonplace.


-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]