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eQWD98RSfr8XHh99J-_yEaL-ZpdMQjgiXfQp-8h4WxmiDKRgYAXLRKPkXnF__-Kv0p3cs36XYXzOfrM4x-zxK-veIzzM-y2ZsxDq30Wa-rzX-Fxl1Rs2va_gar2RXnQqtv3KnT3yu4tLaTljsFNk0zUebeYXAKSFM5FXO2awqhKC0SnNOKK2neTHCKi6UnaMj8ahasYcA4Y-tWI7-PwM5T0mKjeZ0XNB8nPC6oCzjnE5mGc3wWHIiGiZV4nH8v5KRmQfIqltbFCppnT0LmbVy3QoRCCNDJ50S89v406KPiA1ruXoWP6NAdR54_gNLx8Vx>53824</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm-dwarfdump does not handle DW_OP_implicit_pointer
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
wcohen
</td>
</tr>
</table>
<pre>
When using llvm-dwarfdump on some gcc generated code I found that it did not decode location information for items using DW_OP_implicit_pointer. I was able to reproduce the problems from a small example from https://patchwork.ozlabs.org/project/gcc/patch/20100812080522.GL702@tyan-ft48-01.lab.bos.redhat.com/#153158 , dw_op_implicit_pointer.c:
```
struct S
{
int *x, y;
};
int u[6];
static inline void
add (struct S *a, struct S *b, int c)
{
*a->x += *b->x;
a->y += b->y;
u[c + 0]++;
a = (struct S *) 0;
u[c + 1]++;
a = b;
u[c + 2]++;
}
int
foo (int i)
{
int j = i;
struct S p[2] = { {&i, i * 2}, {&j, j * 2} };
add (&p[0], &p[1], 0);
p[0].x = &j;
p[1].x = &i;
add (&p[0], &p[1], 3);
return i + j;
}
int
bar (int i)
{
int *j = &i;
int **k = &j;
int ***l = &k;
i++;
return i;
}
```
compiled with the following on Fedora 35 with gcc-11.2.1-7.fc35.x86_64:
` gcc -g -O2 -c dw_op_implicit_pointer.c `
Look through the resulting dw_op_implicit_pointer.o with llvm-13.0.0-4.fc35.x86_64
`llvm-dwarfdump dw_op_implicit_pointer.o`
See entries like the following where the DW_OP_implicit_pointer (a0) is not decoded:
```
0x00000153: DW_TAG_formal_parameter
DW_AT_abstract_origin (0x000001dd "b")
DW_AT_location (0x00000081:
[0x0000000000000000, 0x0000000000000018): <decoding error> a0 00 00 00 00 10)
DW_AT_GNU_entry_view (0x0000007f)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVluv4yYQ_jXOy8gWviXOQx5O9nSPKq26lXarfbSwwQk52ESAN0l_fQccn8S5dFuL2MDMfPMxwEwqxU6rH1veQW9EtwEpf7YhO1DdsL7dg-rAqJbDpq5hwzuuqeUMasU4_A6N6jsGdkstCAtMMOgUfrkXS1VTK9BedI3S7dDHHqry1py9vf4ov_5ZinYvRS1suVeis1xHgOAHaoBWkoNVoPleK9bXONhywD7OI0ajVQsUTEulBH6kCMOHya21exOkL0HyGdue2np7UPo9Un9LWplI6Y2b1mrHa4s9XN2oht-ExIQUcUIKkidJ9PZlQZIgI_ZEu7CxWRGSOEKYqFIm0pzh8qNatd5VGufYCgiST8AOpdrfr612tMhrQMb3nJybHxqr-9rCt7NwsR46gGG0CPtydNCnIF2PCq-Xvn87vT7I1_MgvxUZi7tQI5IUHYefSrBhnjKG0MXo2rmhzs31ROUmHDZGanlHzlmEQfrbEXvrIH31Fn7igwKA1ziNGl58uhI70rWTAnHUUcspXqxhwJ3QRC6o_Qgjfo5RPTRI7g1ccKeRHTqNUo6Ii4Z4FA0n2HlX4srVB-89-nTehgUt1u4XJHPhI-xWhVzQM44Gwc51dx8CuN5zXNOweajncIfQoeUwjM9D4mhebEbN6HgOKvqYSuOJVPxff-nUn-a2151f3Bp2v4xvRfUv44vR2D2id5Zhe3-0tosYmxw13q817k7NyP4B7-ndHd6YC_ZCYpY8CLv1CatRUqqDy3eYAj9zpjSFNB_kmHrCOI6SKA4XUVOneXQs5uU8u88SPgeHGwi_JhDWT9ML3ND5otQ7stCq3wxsNDe9tI7NEwg1MPOVIE4jEpEwm1Cb8r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