http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970

--- Comment #11 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Bernd Edlinger from comment #10)
> but this should'nt be neccessary then?
> 
>    if (bitoffset > *bitpos)
>      {
>        HOST_WIDE_INT adjust = bitoffset - *bitpos;
> -
>        gcc_assert ((adjust % BITS_PER_UNIT) == 0);
> -      gcc_assert (*offset != NULL_TREE);
>  
>        *bitpos += adjust;
> -      *offset
> -     = size_binop (MINUS_EXPR, *offset, size_int (adjust / BITS_PER_UNIT));
> +      if (*offset == NULL_TREE)
> +     *offset = size_int (-adjust / BITS_PER_UNIT);
> +      else
> +     *offset
> +       = size_binop (MINUS_EXPR, *offset, size_int (adjust / BITS_PER_UNIT));
>        *bitstart = 0;
>      }

Can you prove it isn't necessary?  I mean, *bitpos could still be smaller than
bitoffset, even when not negative, say with some packed+aligned structures
containing bitfields or similar.  NULL_TREE *offset is the same thing as zero
at that spot, just perhaps less efficient in that case, so I think if we can't
prove it will not be hit, it is easy to handle it.

Reply via email to