On Wed, 26 Jul 2017, Jeff Law wrote: > TYPE_SIZE, according to my understanding, should be a tree for the size > of the expression in bits. > > The problem is for msp430 that size varies depending on where it's used. > ie, in a register an object might have a bitsize of 20 bits, but in > memory its size is 32 bits. > > I don't think that TYPE_SIZE has any concept that the use context is > relevant to selecting the proper size.
TYPE_SIZE_UNIT is unambiguously the memory size, including padding; it's used for sizeof. TYPE_SIZE may be less clear. We've had issues before with unions with x87 long double, which has 80-bit precision in registers but is 12-byte or 16-byte in memory; that was wrong code (bug 71522) rather than an ICE, but the long double case may be useful for comparison of what various type properties are set to in such cases. -- Joseph S. Myers jos...@codesourcery.com