On Mon, May 30, 2011 at 9:16 PM, Diego Novillo <dnovi...@google.com> wrote:
> The new routines lto_output_int_in_range and lto_input_int_in_range do
> not seem to be working right.  In the pph branch, we have an LTO_tags
> enum with a range [0 - 351].  This is causing two things:
>
> - The writer gets out of sync with the reader because, we emit
> delimiters with output_zero.  This writes only 1 byte, which then
> confuses input_record_start, which expects to read two bytes.
> - The code that deals with values outside the 0xff range is not
> splitting up the word properly:
>
> lto_output_int_in_range(...)
> [ ... ]
> 1322      val -= min;
> 1323      lto_output_1_stream (obs, val & 255);
> 1324      if (range >= 0xff)
> 1325        lto_output_1_stream (obs, (val << 8) & 255);
> 1326      if (range >= 0xffff)
> 1327        lto_output_1_stream (obs, (val << 16) & 255);
> 1328      if (range >= 0xffffff)
> 1329        lto_output_1_stream (obs, (val << 24) & 255);
>
> Those should be right shifts.  Or am I misreading this code?

Yes, I think they should be right-shifts.

Richard.

>
> Thanks.  Diego.
>

Reply via email to