This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/77589] [6/7 Regression] fortran: Missing DW_AT_byte_stride for an array record field selection
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Sep 2016 09:31:00 +0000
- Subject: [Bug debug/77589] [6/7 Regression] fortran: Missing DW_AT_byte_stride for an array record field selection
- Auto-submitted: auto-generated
- References: <bug-77589-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77589
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to rguenther@suse.de from comment #4)
> So DW_OP_GNU_implicit_ptr doesn't work here? Not sure
> I understand how DW_OP_GNU_implicit_ptr works fully. That is,
>
> ... *(D#1 + 24)
> DW_OP_GNU_implicit_ptr <span.0> + 0
> DW_OP_mul
>
> the examples in the specification always finish the dwarf expression
> with DW_OP_GNU_implicit_ptr which wouldn't be the case here.
No, it doesn't, for 2 reasons:
1) DW_OP_implicit_ptr (DWARF5) / DW_OP_GNU_implicit_ptr (GNU) is a DWARF
location description op, so can't appear in the middle of DWARF expression, but
has to appear on its own; it has a bias argument, so you can say that
int a = 5;
char *b = ((char *) &a) + 2;
b has DW_AT_location DW_OP_GNU_implicit_ptr <a, 2>, but that is it; it is like
DW_OP_reg* or DW_OP_stack_value that can't appear in the middle, and more like
DW_OP_reg* which also has to appear on its own (or say combined through
DW_OP_piece).
2) it doesn't give you the value, but the address of the referenced DIE. So,
if 1) wasn't a problem, you'd need ... DW_OP_implicit_ptr <span.0> DW_OP_deref
DW_OP_mul to get the value and multiply.
I've proposed DW_OP_variable_value for this, will see if I get any feedback on
that.