On Wed, Aug 31, 2011 at 8:09 PM, Aldy Hernandez <al...@redhat.com> wrote: > >> Did you test Ada and enable the C++ memory model? ;) > > See my earlier comment on Ada. Who would ever use the C++ memory model on > Ada?
People interoperating Ada with C++. Our bug triager Zdenek who figures out the --param? >> Btw, even if the bitfield we access (and thus the whole region) is at a >> constant offset, the field _following_ the bitregion (the one you query >> above with get_inner_reference) can be at variable offset. I suggest >> to simply not include any padding in that case (which would be, >> TREE_CODE (DECL_FIELD_OFFSET (fld)) != INTEGER_CST). > > I still have not found a place where we get a variable offset here (after > folding the computation). How about we put a gcc_assert() along with a big > fat comment with your above suggestion when we encounter this. Or can you > give me an example of this case? My point is, the middle-end infrastructure makes it possible for this case to appear, and it seems to be easy to handle conservatively. There isn't a need to wait for users to run into an ICE or an assert we put there IMHO. If I'd be fluent in Ada I'd write you a testcase, but I ain't. >>> Is what you want, that we call get_inner_reference once, and then use >>> DECL_FIELD_OFFSET+DECL_FIELD_BIT_OFFSET to calculate any subsequent bit >>> offset? I found this to be quite tricky with padding, and such, but am >>> willing to give it a whirl again. >> >> Yes. > > I have added a comment to this effect, and will address it along with the > get_inner_reference() removal you have suggested as a followup. Thanks, Richard.