This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [C++ PATCH]: Shrink struct lang_decl


Nathan Sidwell wrote:

This patch shrinks lang_decl from 40 to 32 bytes (on an ILP32 machine).

You'll notice that this limits the size of objects that can be thunked
to 262144 bytes, that is the largest object the standard says a system
need support.  Mark, Jason, if you think this should be made larger
let me know.  There are still some spare bits, but I do have plans
for them :)

I don't really have an opinion about shrinking the maximum object size in this way. I guess it's OK; I certainly can't imagine very many people with virtual bases 262K away from non-virtual parts of the same object. But, I'm not sure that we should in general try to improve the compiler's performance by limiting ourselves in these sorts of ways; surely we don't want identifier length limits! :-)


I agree with Joseph that if we do have such limits, we should have a check for overflow. When using full 32-bit fields, I've not worried about that before, on the grounds that virtual memory has probably been exhausted by the time we get there, or that some other part of the compiler will check for overflow of an INTEGER_CST, but here we really could silently generate wrong code for super-big objects.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com


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