]> git.ipfire.org Git - thirdparty/gcc.git/commit
dwarf2out: Handle COMPOUND_LITERAL_EXPR in loc_list_from_tree_1 [PR101266]
authorJakub Jelinek <jakub@redhat.com>
Thu, 1 Jul 2021 07:45:02 +0000 (09:45 +0200)
committerJakub Jelinek <jakub@redhat.com>
Thu, 1 Jul 2021 07:45:02 +0000 (09:45 +0200)
commitb0ab968999c9af88d45acf552ca673ef3960306a
tree74cf65b67e230b82b5f7c1c7b61416b5d7b275ee
parent91c771ec8a3b649765de3e0a7b04cf946c6649ef
dwarf2out: Handle COMPOUND_LITERAL_EXPR in loc_list_from_tree_1 [PR101266]

In this case dwarf2out_decl is called from the FEs with GENERIC but not
yet gimplified expressions in it.

As loc_list_from_tree_1 has an exhaustive list of tree codes it wants to
handle and for checking asserts no other codes makes it in, we should
handle even GENERIC trees that shouldn't be valid in GIMPLE.

The following patch handles COMPOUND_LITERAL_EXPR by hnadling it like the
underlying VAR_DECL temporary.

Verified the emitted DWARF is correct (but unoptimized, we emit
DW_OP_lit1 DW_OP_lit1 DW_OP_minus for the upper bound).

2021-07-01  Jakub Jelinek  <jakub@redhat.com>

PR debug/101266
* dwarf2out.c (loc_list_from_tree_1): Handle COMPOUND_LITERAL_EXPR.

* gcc.dg/pr101266.c: New test.
gcc/dwarf2out.c
gcc/testsuite/gcc.dg/pr101266.c [new file with mode: 0644]