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]
Other format: [Raw text]

Re: lto gimple types and debug info


Kenneth Zadeck wrote:
Paolo Bonzini wrote:
Mark Mitchell wrote:
For that matter, "print sizeof(X)" should print the same value when debugging optimized code as when debugging unoptimized code, even if the compiler has optimized X away to an empty structure!

I disagree. sizeof(X) in the code will return a value as small as possible in that case (so that malloc-ing an array of structures) does not waste memory, and the debugger should do the same.


Paolo

I think I agree with paolo here.

I don't think that's a viable option. The value of sizeof(X) is a compile-time constant, specified by a combination of ISO C and platform ABI rules. In C++, sizeof(X) can even be used as a (constant) template parameter, way before we get to any optimization.


--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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