mirror of git://gcc.gnu.org/git/gcc.git
dwarf2out: Use normal constant values in bound_info if possible.
* dwarf2out.c (add_bound_info): If HOST_WIDE_INT is big enough, then represent the bound as normal constant value. From-SVN: r209473
This commit is contained in:
parent
5a65129e4e
commit
79896351cb
|
|
@ -1,3 +1,8 @@
|
||||||
|
2014-03-20 Mark Wielaard <mjw@redhat.com>
|
||||||
|
|
||||||
|
* dwarf2out.c (add_bound_info): If HOST_WIDE_INT is big enough,
|
||||||
|
then represent the bound as normal constant value.
|
||||||
|
|
||||||
2014-04-17 Jakub Jelinek <jakub@redhat.com>
|
2014-04-17 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
PR target/60847
|
PR target/60847
|
||||||
|
|
|
||||||
|
|
@ -16203,21 +16203,31 @@ add_bound_info (dw_die_ref subrange_die, enum dwarf_attribute bound_attr, tree b
|
||||||
&& tree_to_shwi (bound) == dflt)
|
&& tree_to_shwi (bound) == dflt)
|
||||||
;
|
;
|
||||||
|
|
||||||
/* Otherwise represent the bound as an unsigned value with the
|
/* If HOST_WIDE_INT is big enough then represent the bound as
|
||||||
precision of its type. The precision and signedness of the
|
a constant value. We need to choose a form based on
|
||||||
type will be necessary to re-interpret it unambiguously. */
|
whether the type is signed or unsigned. We cannot just
|
||||||
else if (prec < HOST_BITS_PER_WIDE_INT)
|
call add_AT_unsigned if the value itself is positive
|
||||||
{
|
(add_AT_unsigned might add the unsigned value encoded as
|
||||||
unsigned HOST_WIDE_INT mask
|
DW_FORM_data[1248]). Some DWARF consumers will lookup the
|
||||||
= ((unsigned HOST_WIDE_INT) 1 << prec) - 1;
|
bounds type and then sign extend any unsigned values found
|
||||||
add_AT_unsigned (subrange_die, bound_attr,
|
for signed types. This is needed only for
|
||||||
TREE_INT_CST_LOW (bound) & mask);
|
DW_AT_{lower,upper}_bound, since for most other attributes,
|
||||||
}
|
consumers will treat DW_FORM_data[1248] as unsigned values,
|
||||||
else if (prec == HOST_BITS_PER_WIDE_INT
|
regardless of the underlying type. */
|
||||||
|
else if (prec <= HOST_BITS_PER_WIDE_INT
|
||||||
|| TREE_INT_CST_HIGH (bound) == 0)
|
|| TREE_INT_CST_HIGH (bound) == 0)
|
||||||
add_AT_unsigned (subrange_die, bound_attr,
|
{
|
||||||
TREE_INT_CST_LOW (bound));
|
if (TYPE_UNSIGNED (TREE_TYPE (bound)))
|
||||||
|
add_AT_unsigned (subrange_die, bound_attr,
|
||||||
|
TREE_INT_CST_LOW (bound));
|
||||||
|
else
|
||||||
|
add_AT_int (subrange_die, bound_attr, TREE_INT_CST_LOW (bound));
|
||||||
|
}
|
||||||
else
|
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_double (subrange_die, bound_attr, TREE_INT_CST_HIGH (bound),
|
add_AT_double (subrange_die, bound_attr, TREE_INT_CST_HIGH (bound),
|
||||||
TREE_INT_CST_LOW (bound));
|
TREE_INT_CST_LOW (bound));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue