From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14077 invoked by alias); 31 Jul 2017 23:08:17 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 14041 invoked by uid 89); 31 Jul 2017 23:08:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS,URIBL_RED autolearn=ham version=3.3.2 spammy=varies X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 31 Jul 2017 23:08:15 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1dcJnI-00013M-Fo from joseph_myers@mentor.com ; Mon, 31 Jul 2017 16:08:12 -0700 Received: from digraph.polyomino.org.uk (137.202.0.87) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 1 Aug 2017 00:08:09 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.86_2) (envelope-from ) id 1dcJnB-00054E-BX; Mon, 31 Jul 2017 23:08:05 +0000 Date: Mon, 31 Jul 2017 23:08:00 -0000 From: Joseph Myers To: Jeff Law CC: Jozef Lawrynowicz , Subject: Re: ping [PATCH] [MSP430] Fix PR78849: ICE on initialization of global struct containing __int20 array In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-SW-Source: 2017-07/txt/msg02081.txt.bz2 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 joseph@codesourcery.com