* [Bug c/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
@ 2021-06-30 6:43 ` rguenth at gcc dot gnu.org
2021-06-30 7:25 ` marxin at gcc dot gnu.org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-30 6:43 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|debug |c
Ever confirmed|0 |1
Version|tree-ssa |12.0
Last reconfirmed| |2021-06-30
Status|UNCONFIRMED |NEW
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed. We hit
#1 0x0000000000d898e5 in loc_list_from_tree_1 (loc=
<compound_literal_expr 0x7ffff6688240>, want_address=0, context=0x0)
at /home/rguenther/src/gcc2/gcc/dwarf2out.c:19421
19421 gcc_unreachable ();
(gdb) l
19416 }
19417
19418 /* Otherwise this is a generic code; we should just lists all of
19419 these explicitly. We forgot one. */
19420 if (flag_checking)
19421 gcc_unreachable ();
(gdb) p loc
$1 = <compound_literal_expr 0x7ffff6688240>
(gdb) p debug_generic_expr (loc)
<<< Unknown tree: compound_literal_expr
int D.1943 = 1; >>>
and the original tree we ask for is
(long int) SAVE_EXPR <<<< Unknown tree: compound_literal_expr
int D.1943 = 1; >>>> + -1
this looks like some missed DECL_EXPR / gimplification or a missed error.
clang complains:
> clang-9 t.c -S
t.c:1:9: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
typedef U;
~~~~~~~ ^
t.c:2:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
fn8(U (*)[(int){1}]) {}
^
t.c:2:9: error: parameter name omitted
fn8(U (*)[(int){1}]) {}
^
2 warnings and 1 error generated.
but adding a parameter name doesn't fix anything. Note we call
dwarf2out_decl via
#14 0x0000000000d9f4f4 in dwarf2out_type_decl (
decl=<type_decl 0x7ffff656b428>, local=0)
at /home/rguenther/src/gcc2/gcc/dwarf2out.c:27099
#15 0x000000000120699d in rest_of_decl_compilation (
decl=<type_decl 0x7ffff656b428>, top_level=1, at_end=0)
at /home/rguenther/src/gcc2/gcc/passes.c:251
#16 0x0000000000a614a7 in finish_decl (decl=<type_decl 0x7ffff656b428>,
init_loc=246464, init=<tree 0x0>, origtype=<tree 0x0>,
asmspec_tree=<tree 0x0>) at /home/rguenther/src/gcc2/gcc/c/c-decl.c:5606
#17 0x0000000000a65c38 in grokdeclarator (declarator=0x385b320,
declspecs=0x385b170, decl_context=PARM, initialized=false, width=0x0,
decl_attrs=0x7fffffffd628, expr=0x7fffffffd648,
expr_const_operands=0x7fffffffd49f, deprecated_state=DEPRECATED_NORMAL)
at /home/rguenther/src/gcc2/gcc/c/c-decl.c:7171
so this is before any gimplification happened.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
2021-06-30 6:43 ` [Bug c/101266] " rguenth at gcc dot gnu.org
@ 2021-06-30 7:25 ` marxin at gcc dot gnu.org
2021-06-30 11:04 ` [Bug debug/101266] " jakub at gcc dot gnu.org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-06-30 7:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |marxin at gcc dot gnu.org,
| |rsandifo at gcc dot gnu.org
--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r8-6733-gd74641bdd752306a.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug debug/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
2021-06-30 6:43 ` [Bug c/101266] " rguenth at gcc dot gnu.org
2021-06-30 7:25 ` marxin at gcc dot gnu.org
@ 2021-06-30 11:04 ` jakub at gcc dot gnu.org
2021-06-30 11:17 ` jakub at gcc dot gnu.org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-30 11:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Component|c |debug
Status|NEW |ASSIGNED
CC| |jakub at gcc dot gnu.org
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
As dwarf2out.c is called on pre-gimplification GENERIC in that case, it should
handle GENERIC trees.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug debug/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
` (2 preceding siblings ...)
2021-06-30 11:04 ` [Bug debug/101266] " jakub at gcc dot gnu.org
@ 2021-06-30 11:17 ` jakub at gcc dot gnu.org
2021-07-01 7:46 ` cvs-commit at gcc dot gnu.org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-06-30 11:17 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 51089
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51089&action=edit
gcc12-pr101266.patch
Untested fix.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug debug/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
` (3 preceding siblings ...)
2021-06-30 11:17 ` jakub at gcc dot gnu.org
@ 2021-07-01 7:46 ` cvs-commit at gcc dot gnu.org
2021-07-01 7:54 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-01 7:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:b0ab968999c9af88d45acf552ca673ef3960306a
commit r12-1948-gb0ab968999c9af88d45acf552ca673ef3960306a
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Jul 1 09:45:02 2021 +0200
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.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug debug/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
` (4 preceding siblings ...)
2021-07-01 7:46 ` cvs-commit at gcc dot gnu.org
@ 2021-07-01 7:54 ` jakub at gcc dot gnu.org
2021-07-18 23:29 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-07-01 7:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed on the trunk so far.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug debug/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
` (5 preceding siblings ...)
2021-07-01 7:54 ` jakub at gcc dot gnu.org
@ 2021-07-18 23:29 ` cvs-commit at gcc dot gnu.org
2022-05-10 8:19 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-07-18 23:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:135680bdce4577208daf0507089ac932abdbf5f9
commit r11-8769-g135680bdce4577208daf0507089ac932abdbf5f9
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Jul 1 09:45:02 2021 +0200
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.
(cherry picked from commit b0ab968999c9af88d45acf552ca673ef3960306a)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug debug/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
` (6 preceding siblings ...)
2021-07-18 23:29 ` cvs-commit at gcc dot gnu.org
@ 2022-05-10 8:19 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:21 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:36 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-10 8:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:cd1076871987740312a040fba9ba4e7c047bdedf
commit r10-10629-gcd1076871987740312a040fba9ba4e7c047bdedf
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Jul 1 09:45:02 2021 +0200
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.
(cherry picked from commit b0ab968999c9af88d45acf552ca673ef3960306a)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug debug/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
` (7 preceding siblings ...)
2022-05-10 8:19 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:21 ` cvs-commit at gcc dot gnu.org
2022-05-11 6:36 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-11 6:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
<jakub@gcc.gnu.org>:
https://gcc.gnu.org/g:1df7b899cd854fdda052fb6218c2ff9e8898df42
commit r9-10086-g1df7b899cd854fdda052fb6218c2ff9e8898df42
Author: Jakub Jelinek <jakub@redhat.com>
Date: Thu Jul 1 09:45:02 2021 +0200
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.
(cherry picked from commit b0ab968999c9af88d45acf552ca673ef3960306a)
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug debug/101266] ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421
2021-06-30 5:14 [Bug debug/101266] New: ICE with -g: in loc_list_from_tree_1, at dwarf2out.c:19421 cnsun at uwaterloo dot ca
` (8 preceding siblings ...)
2022-05-11 6:21 ` cvs-commit at gcc dot gnu.org
@ 2022-05-11 6:36 ` jakub at gcc dot gnu.org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-05-11 6:36 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101266
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 11+ messages in thread