This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: V3 patch causes EH failures in ILP32 mode
Gabriel Dos Reis wrote:
You Wrote
Well, I added these so that -Weffc++ could be used in CXXFLAGS while
building libstdc++. This was a longstanding issue w/ v3 that was an
annoyance to several C++ maintainers (myself included, naturally!).
Ugh. Do you really think this kind of change is worth it?
I do not; but Benjamin already knows my opinion on that matter.
Someone pointed me at the thread where you discussed the fact that
adding a copy constructor would prevent these variables from being
returned in a register. There was some follow-on discussion about what
the optimizers would eventually be able to do, but I'm not sure if one
of the key issues you raised was fully discussed.
In particular, adding an explicit copy constructor or destructor to a
class that would otherwise have a trivial version (in the technical C++
sense of "trivial") will cause the compiler to pass and return instances
of this type in memory, rather than in registers. There's nothing that
the optimizers can do about that; it's an ABI issue. If functions are
inlined, the optimizers may be able to fix it up -- but if not, you lose.
So, adding copy constructor and destructor definitions is *definitely* a
pessimization in these cases -- as well as an ABI change (!).
I see that Dan Jacobowitz brought up this issue, but I don't see that
Benjamin ever replied; was this issue ever resolved?
None of this, of course, excuses the ILP32 IA64 compiler from generating
wrong code...
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com