Bitfield conversion bug in 4.2?

Jim Wilson wilson@specifix.com
Mon Mar 19 20:43:00 GMT 2007


Eric Lemings wrote:
> Is this a bug or new behavior?  If the latter, what is this attributed
> to?

FYI gcc-bugs isn't the best place to ask questions, as it is mostly used 
for output from our bug database.

I'm not a C++ expert, so I'm not the right person to say for sure, but 
this looks like an accidental bug to me.  There were patches added to 
change the bitfield type representation, the 
is_bitfield_expr_with_lowered_type change, which is for PR 26534.  I 
believe these patches have an error.

It looks to me like the bug is in standard_conversion in cp/calls.c at 
these lines
           if (bitfield_type)
             from = strip_top_quals (bitfield_type);
This sets from, but fails to set fcode, resulting in an inconsistency. 
In this case, fcode is INTEGER_TYPE and from is now an enumeral type 
after originally being an integer type.  This causes a failure further 
down in the tcode == BOOLEAN_TYPE code where we fail to match the 
conditions due to this inconsistency.

I'd suggest opening a bug report.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com



More information about the Gcc-bugs mailing list