https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108496

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.  With -O0 we ICE like

> ./cc1plus -quiet t.ii   
during RTL pass: expand
t.ii: In function 'S foo(S) [with int <anonymous> = 0; <template-parameter-1-2>
= long int]':
t.ii:10:10: internal compiler error: in make_decl_rtl, at varasm.cc:1439
   10 |   return s;
      |          ^
0x1eaa4a7 make_decl_rtl(tree_node*)
        /home/rguenther/src/trunk/gcc/varasm.cc:1438
0x14421f3 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/rguenther/src/trunk/gcc/expr.cc:10870
0x1439718 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
        /home/rguenther/src/trunk/gcc/expr.cc:9004
0x1414a44 expand_expr
        /home/rguenther/src/trunk/gcc/expr.h:310
0x142c41f expand_assignment(tree_node*, tree_node*, bool)
        /home/rguenther/src/trunk/gcc/expr.cc:5987

it looks like there's a stray RESULT_DECL w/o DECL_CONTEXT in this function
allocated by

0x0000000000de99c0 in grokdeclarator (declarator=0x4870c40,
declspecs=0x7fffffffda30, decl_context=NORMAL, initialized=0,
attrlist=0x7fffffffdaa0) at /home/rguenther/src/trunk/gcc/cp/decl.cc:14782
14782               tree resdecl = build_decl (loc, RESULT_DECL, 0, restype);
Value returned is $9 = (tree_node *) 0x7ffff642a0f0
(gdb) l
14777           /* If we saw a return type, record its location.  */
14778           location_t loc = declspecs->locations[ds_type_spec];
14779           if (loc != UNKNOWN_LOCATION)
14780             {
14781               tree restype = TREE_TYPE (TREE_TYPE (decl));
14782               tree resdecl = build_decl (loc, RESULT_DECL, 0, restype);
14783               DECL_ARTIFICIAL (resdecl) = 1;
14784               DECL_IGNORED_P (resdecl) = 1;
14785               DECL_RESULT (decl) = resdecl;

Reply via email to