This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ping [PATCH] [MSP430] Fix PR78849: ICE on initialization of global struct containing __int20 array
- From: Jeff Law <law at redhat dot com>
- To: Joseph Myers <joseph at codesourcery dot com>
- Cc: Jozef Lawrynowicz <jozef dot l at somniumtech dot com>, gcc-patches at gcc dot gnu dot org
- Date: Wed, 2 Aug 2017 10:21:04 -0600
- Subject: Re: ping [PATCH] [MSP430] Fix PR78849: ICE on initialization of global struct containing __int20 array
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C6043356EA
- References: <CAG7DreZcfmbvFj_S-dZvC9wCxf3pSiw4q-Kum-4zDddAssvKgA@mail.gmail.com> <b8c38929-f683-21f6-ab01-9a0e4b915395@redhat.com> <alpine.DEB.2.20.1707312303140.19386@digraph.polyomino.org.uk>
On 07/31/2017 05:08 PM, Joseph Myers wrote:
> 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.
Thanks for the clarification. I wandered around a bit before commenting
on Jozef's patch and didn't come across anything which made it
unambiguous.
And yes, x87 long doubles are a good example to compare/contrast against.
jeff