On 31/10/16 19:50, Jason Merrill wrote:
On 10/21/2016 04:30 AM, Jiong Wang wrote:
All DW_OP_* of the expression are grouped together inside the PARALLEL,
and those operations which don't have RTL mapping are wrapped by
UNSPEC. The parsing algorithm is simply something like:
foreach elem inside PARALLEL
if (UNSPEC)
{
dw_op_code = INTVAL (XVECEXP (elem, 0, 0));
oprnd1 = INTVAL (XVECEXP (elem, 0, 1));
oprnd2 = INTVAL (XVECEXP (elem, 0, 2));
}
else
call standard RTL parser.
Any comments on the approach?
If you're going to use UNSPEC, why not put the DWARF operator in the
second operand?
Hi Jason,
Thanks for the review, but I still don't understand your meaning.
Do you mean I should simply put the DWARF operator at XVECEXP
(UNSPEC_RTX, 0, 2)
instead of at XVECEXP (UNSPEC_RTX, 0, 0), and the new parsing
algorithm will be
the following ?
foreach elem inside PARALLEL
if (UNSPEC)
{
oprnd1 = INTVAL (XVECEXP (elem, 0, 0));
oprnd2 = INTVAL (XVECEXP (elem, 0, 1));
dw_op_code = INTVAL (XVECEXP (elem, 0, 2));
}
else
call standard RTL parser.
I actually don't see the benefit of this change, could you please
give more
comments on this?
For this patch, suppose the unwinding rule for register A is poping two
values from dwarf evalutaion stack, do some complex processing based on
the two values, then push back the result on to stack.
We can generate the dwarf value expression description like:
(set (reg A)
(parallel
[(reg A) (reg B)
(UNSPEC
[(const_int DW_OP_XXX) (const0_rtx) (const0_rtx)]
UNSPEC_NUM)
then readelf dump will be something like
===
DW_CFA_val_expression: A (DW_OP_bregB: 0; DW_OP_bregC: 0; DW_OP_XXX)
We can't do such description based on current GCC dwarf code, right?