This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR c++/42217


Le lundi 30 nov. 2009 à 22:39:23 (-0500), Jason Merrill a écrit:
> On 11/30/2009 05:19 PM, Dodji Seketeli wrote:
> >remove_zero_width_bit_fields fails to remove zero-width unnamed bit fields
> >from a given struct. It thinks the size of the bit field is stored in the
> >DECL_INITIAL property of the bit field, but that size is eventually stored
> >in the DECL_SIZE property by check_bitfield_decl.
> 
> What changed since 4.4 to make this break?

Interesting question.

I ran an automatic bisect between r132394 (2008/02/18) and current trunk
and it seems the ICE was introduced by r153573:
http://gcc.gnu.org/viewcvs?view=revision&revision=153573

But that change just uncovered the issue by adding an assert
that is IMHO correct:
* fold-const.c (fit_double_type): Use int_or_pointer_precision.

In other words, we detect the issue thanks to r153573. Before that revision,
I think the zero-width unamed bit field was silently kept in the struct.
I ran r114245 - which is 3+ years old
(http://gcc.gnu.org/viewcvs?view=revision&revision=114245) - in a
debugger and noticed the issue was already (silently) present by then.
So I don't know exactly when the root issue was introduced, but it looks
like it has been (silently) there fore quite some time. I am not sure it
really caused any arm though, but I guess it ought to be fixed.

        Dodji


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]