This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/58970] [4.7/4.8/4.9 Regression] internal compiler error: in get_bit_range, at expr.c:4562
- From: "bernd.edlinger at hotmail dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 04 Nov 2013 10:05:49 +0000
- Subject: [Bug middle-end/58970] [4.7/4.8/4.9 Regression] internal compiler error: in get_bit_range, at expr.c:4562
- Auto-submitted: auto-generated
- References: <bug-58970-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58970
--- Comment #12 from Bernd Edlinger <bernd.edlinger at hotmail dot de> ---
(In reply to Jakub Jelinek from comment #11)
> (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.
hmm, my english...
I meant the change here is not necessary, because after the
if (*bitpos < 0) {...},
*offset can no longer be NULL, and I'd leave the assertion untouched.