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: [lto/pph] Do not pack more bits than requested (issue4415044)


On Fri, Apr 15, 2011 at 08:49, Richard Guenther <rguenther@suse.de> wrote:
> On Fri, 15 Apr 2011, Diego Novillo wrote:
>
>> On Fri, Apr 15, 2011 at 04:56, Richard Guenther <rguenther@suse.de> wrote:
>>
>> >> @@ -518,7 +518,8 @@ pack_ts_type_value_fields (struct bitpack_d *bp, tree expr)
>> >> Â Âbp_pack_value (bp, TYPE_USER_ALIGN (expr), 1);
>> >> Â Âbp_pack_value (bp, TYPE_READONLY (expr), 1);
>> >> Â Âbp_pack_value (bp, TYPE_ALIGN (expr), HOST_BITS_PER_INT);
>> >> - Âbp_pack_value (bp, TYPE_ALIAS_SET (expr) == 0 ? 0 : -1, HOST_BITS_PER_INT);
>> >> + Âbp_pack_value (bp, TYPE_ALIAS_SET (expr) == 0 ? 0 : -1,
>> >> + Â Â Â Â Â Â Â ÂBITS_PER_BITPACK_WORD);
>> >
>> > As we only want to stream alias-set zeros just change it to a single bit,
>> > like
>> >
>> > Â Â bp_pack_value (bp, TYPE_ALIAS_SET (expr) == 0, 1);
>> >
>> > and on the reader side restore either a zero or -1.
>>
>> Ah, yes. ÂMuch better.
>>
>> > As for the -1 case, it's simply broken use of the interface.
>>
>> Which would've been caught by the assertion. ÂHow about this, we keep
>> the asserts with #ifdef ENABLE_CHECKING. This would've saved me some
>> ugly debugging.
>
> I think we should rather add the masking. ÂThe assert would only
> trigger for particular values, not for bogus use of the interface
> (you get sign-extension for signed arguments).

OK, that works too.  I'll prepare a patch.


Diego.


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