[PATCH] Fix get_bit_range and expand_assignment for negative bitpos (PR middle-end/58970)
Jeff Law
law@redhat.com
Tue Nov 5 20:17:00 GMT 2013
On 11/05/13 01:01, Jakub Jelinek wrote:
> Hi!
>
> This is an updated version of the get_bit_range fix, this time it
> ensures that bitpos is not negative already right after the
> get_inner_reference call, because various parts of the expansion might be
> confused by the negative values. As the second testcase shows, even with
> non-negative bitpos we can still end up with bitoffset > *bitpos when *offset
> is NULL, so get_bit_range handles that too.
>
> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk (and
> after a while 4.8)?
>
> 2013-11-05 Jakub Jelinek <jakub@redhat.com>
>
> PR middle-end/58970
> * expr.c (get_bit_range): Handle *offset == NULL_TREE.
> (expand_assignment): If *bitpos is negative, set *offset
> and adjust *bitpos, so that it is not negative.
>
> * gcc.c-torture/compile/pr58970-1.c: New test.
> * gcc.c-torture/compile/pr58970-2.c: New test.
OK for the trunk. Your call if/when for the 4.8 branch.
jeff
More information about the Gcc-patches
mailing list