From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29965 invoked by alias); 30 May 2005 18:36:59 -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 29947 invoked by alias); 30 May 2005 18:36:57 -0000 Date: Mon, 30 May 2005 18:37:00 -0000 Message-ID: <20050530183657.29946.qmail@sourceware.org> From: "kenner at vlsi1 dot ultra dot nyu dot edu" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050420232738.21135.mrs@apple.com> References: <20050420232738.21135.mrs@apple.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/21135] [4.0/4.1 Regression] &a[-2] ICE at the top level X-Bugzilla-Reason: CC X-SW-Source: 2005-05/txt/msg03908.txt.bz2 List-Id: ------- Additional Comments From kenner at vlsi1 dot ultra dot nyu dot edu 2005-05-30 18:36 ------- Subject: Re: [4.0/4.1 Regression] &a[-2] ICE at the top level The difference in the handling of these two expressions is that get_inner_reference sets the "offset" out-parameter for &a[-2], but not for a[2]. That's at odds with its documentation, which says that offset is only set if the offset is not a constant. Is this because the value doesn't fit in some type? I don't understand why it's doing that. Furthermore, the out-parameter "bitpos" is signed, which suggests that negative values should be acceptable. I think this is just consistency: bitpos is signed all over the place. But, actually, I think there are some cases where the are negative bit positions: the object a thin pointer in Ada points to comes to mind. Changing get_inner_reference to use ssizetype and sbitsizetype throughout fixes the problems -- but I'm not sure if that's 100% correct. Nor am I, but I can't offhand think of anything it would breajk. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21135