http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51994
--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-25
12:42:14 UTC ---
(In reply to comment #2)
> > Negative bitpos is fine - Ada uses that quite extensively and with MEM_REFs
> > this just got more prominent. get_inner_reference is declared to return
> > a _signed_ HOST_WIDE_INT bitpos for a reason.
>
> Extensively is a bit of an overstatement, but Ada does use negative offsets.
> The recent story about them in build_ref_for_model shows that they can be
> problematic though.
>
> > What should happen instead is that store_field needs to adjust the address
> > to properly point before the bitfield for calling store_bit_field. Or the
> > latter needs to take signed arguments for bitpos and do the adjustment
> > itself.
> >
> > Does simply changing the store_bit_field[_1] prototype work for you?
>
> It might also be interesting to find out why we have a negative bitpos here.
It's as easy as doing
int foo(int *p)
{
return p[-1];
}
these days.