On Mon, Dec 01, 2014 at 04:29:05PM +0100, Pierre-Marie de Rodat wrote:
> >>+ expansion_failed (loc, NULL_RTX,
> >>+ "PLACEHOLDER_EXPR for a unexpected type");
> >
> >for an unexpected type?
>
> Yes: placeholder expressions are supposed only to refer to the type allowed
> by the context. I updated the message to talk about the context and I added
> another one for the (invalid) case when want_address == 0.
I meant that you wrote "a" rather than "an".
> Beyond this, I checked diffs for -O0, -O1 and -O2 (each one with -g -dA).
> Trying to skip all the noise caused by the changes of DIE
> offsets/abbreviation numbers, the only significant changes I could find look
> legitimate:
>
> - Volatile array types used not to be described as such: after my patches
> they are wrapped in DW_TAG_volatile_type DIEs.
Guess that is ok.
> - DW_AT_{lower,upper}_bound attributes are now encoded as DW_FORM_sdata
> (i.e. SLEB128) instead of as DW_FORM_data1/2/4/8. This is a clear win for
> negative ones.
That might be a compatibility issue for older debuggers, especially for the
strict dwarf cases. Where does this difference come from? Why doesn't
> + /* If HOST_WIDE_INT is big enough then represent the bound as
> + a constant value. We need to choose a form based on
> + whether the type is signed or unsigned. We cannot just
> + call add_AT_unsigned if the value itself is positive
> + (add_AT_unsigned might add the unsigned value encoded as
> + DW_FORM_data[1248]). Some DWARF consumers will lookup the
> + bounds type and then sign extend any unsigned values found
> + for signed types. This is needed only for
> + DW_AT_{lower,upper}_bound, since for most other attributes,
> + consumers will treat DW_FORM_data[1248] as unsigned values,
> + regardless of the underlying type. */
> + if (prec <= HOST_BITS_PER_WIDE_INT
> + || tree_fits_uhwi_p (value))
> + {
> + if (TYPE_UNSIGNED (TREE_TYPE (value)))
> + add_AT_unsigned (die, attr, TREE_INT_CST_LOW (value));
> + else
> + add_AT_int (die, attr, TREE_INT_CST_LOW (value));
> + }
> + else
> + /* Otherwise represent the bound as an unsigned value with
> + the precision of its type. The precision and signedness
> + of the type will be necessary to re-interpret it
> + unambiguously. */
> + add_AT_wide (die, attr, value);
handle it the same as it used to? Unconditional DW_FORM_sdata is certainly
not a size win for various values...
Jakub