------- 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