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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] libstdc++/12854


Benjamin Kosnik <bkoz@redhat.com> writes:

| Editing this:
| http://gcc.gnu.org/ml/libstdc++/2004-04/msg00067.html
| 
| I get the following patch, which removes all possible compiler
| diagnostics when -Weffc++ is used with libstdc++.

-Weffec++ is awful.  

It was written for a period where the world was viewed as
object-oriented and some specific rules should be followed otherwise
one goes to hell. 

There is at least one case of the changes that makes me very uneasy
because it hurts performance for no perceived benefit: The change to
__normal_iterator. 

Declaring copy-constructor for __normal_iterator *is* a hurting
pessimization: 
The compiler is no longer going to treat it as "normal" C-struct and
pass it in register on plateforms (like PowerPC) it fits in a
register. Instead, return-values or function arguments of that type
would unconditionally be pushed on stack. That would be a step to make
our std::vector<T>::iterator more inefficient.  It hurts effort
like ADDRESSOF, designed precisely to remove the "abstraction penalty"
in putting simple data in structs like __normal_iterator.

    http://www.codesourcery.com/cxx-abi/abi.html#calls


I think, only people who insist on -Weffec++ should pay for that
inefficiency.  Usually, they're concerned with a kind of codes where
everything is passed by reference.  We cannot not assume that our
implementation of STL is going to be used only in those specific
cases. 

-- Gaby


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