From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6259 invoked by alias); 27 Sep 2005 10:51:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 6196 invoked by alias); 27 Sep 2005 10:51:11 -0000 Date: Tue, 27 Sep 2005 10:51:00 -0000 Message-ID: <20050927105111.6195.qmail@sourceware.org> From: "nathan at codesourcery dot com" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050925101726.24053.laurent@guerby.net> References: <20050925101726.24053.laurent@guerby.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug middle-end/24053] [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 X-Bugzilla-Reason: CC X-SW-Source: 2005-09/txt/msg03175.txt.bz2 List-Id: ------- Additional Comments From nathan at codesourcery dot com 2005-09-27 10:51 ------- Subject: Re: [4.1 Regression] Ada bootstrap ICE in build_int_cst_wide, at tree.c:795 ebotcazou at gcc dot gnu dot org wrote: > In build_int_cst_wide, we're asserting that the type of shared constants > attached to a type is precisely that type: > > t = TREE_VEC_ELT (TYPE_CACHED_VALUES (type), ix); > if (t) > { > /* Make sure no one is clobbering the shared constant. */ > gcc_assert (TREE_TYPE (t) == type); > > But in set_sizetype we're boldly copying TYPE_CACHED_VALUES between types: > > /* We do want to use bitsizetype's cache, as we will be replacing that > type. */ > TYPE_CACHED_VALUES (t) = TYPE_CACHED_VALUES (bitsizetype); > TYPE_CACHED_VALUES_P (t) = TYPE_CACHED_VALUES_P (bitsizetype); > > > Nathan, who is right here? Both are correct. However it looks like some integer constant created before set_sizetype is called has not got its type updated correctly. The problem here is that we have to create some types before setting size_type, and in creating those types we need to set their size to some integral constant, and that integral constant has to have a type. That uses the stub sizetype type, which we overwrite further down set_sizetype. /* Replace our original stub sizetype. */ memcpy (sizetype, t, tree_size (sizetype)); TYPE_MAIN_VARIANT (sizetype) = sizetype; My guess is that we've already created some type variants of the stub type at that point, which is not what I expected. There should really be an gcc_assert (!TYPE_NEXT_VARIANT (sizetype) && !TYPE_NEXT_VARIANT (t)); just before the memcpy nathan -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24053