On Thu, Jan 12, 2017 at 05:42:55PM +0100, Pierre-Marie de Rodat wrote:
> > +      object_offset_in_bytes
> > +   = wi::lrshift (object_offset_in_bits, LOG2_BITS_PER_UNIT);
> > +      if (ctx->variant_part_offset == NULL_TREE)
> > +   {
> > +     *cst_offset = object_offset_in_bytes.to_shwi ();
> > +     return NULL;
> > +   }
> > +      tree_result = wide_int_to_tree (sizetype, object_offset_in_bytes);
> 
> I don’t understand this special case: IIUC, if this IF block was missing,
> the flow would make this function return the same result thanks to the
> similar IF block several lines below. Is it to avoid the conversions to
> tree/wide int/HOST_WIDE_INT (i.e. an optimization)?

Yes, the if (ctx->variant_part_offset == NULL_TREE) block is optimization
for the most common case.

        Jakub

Reply via email to