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

            Bug ID: 89512
           Summary: ICE in get_expr_operands, at tree-ssa-operands.c:882
           Product: gcc
           Version: 9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to gcc-5, no ICE seen with 4.9 or older :


$ cat z1.cc
struct A {
  template <typename A>
  static const int a = 0;
};
struct B {
  template <typename B>
  static int foo ()
  {
    return B::a;
  }
};
int bar ()
{
  int i = B::foo<A> ();
}


$ g++-9-20190224 -c z1.cc
z1.cc: In function 'int bar()':
z1.cc:15:1: warning: no return statement in function returning non-void
[-Wreturn-type]
   15 | }
      | ^
unhandled expression in get_expr_operands():
 <template_decl 0x7f4cbd04c180 a
    type <integer_type 0x7f4cbd179bd0 int readonly sizes-gimplified type_6 SI
        size <integer_cst 0x7f4cbd044078 constant 32>
        unit-size <integer_cst 0x7f4cbd044090 constant 4>
        align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f4cbd179bd0 precision:32 min <integer_cst 0x7f4cbd044030 -2147483648> max
<integer_cst 0x7f4cbd044048 2147483647>>
    used decl_1 VOID z1.cc:3:20
    align:1 warn_if_not_align:0 context <record_type 0x7f4cbd1799d8 A>
    parms <tree_list 0x7f4cbd17b320
        purpose <integer_cst 0x7f4cbd022f30 constant 1>
        value <tree_vec 0x7f4cbd1872a0 type <template_decl 0x7f4cbd04c180 a>
            length:1
            elt:0 <tree_list 0x7f4cbd17b2f8 value <type_decl 0x7f4cbd1457b8
A>>>>
    full-name "template<class A> const int A::a<A>"
    chain <type_decl 0x7f4cbd145720 A>>

during GIMPLE pass: ssa
z1.cc: In static member function 'static int B::foo() [with B = A]':
z1.cc:15:1: internal compiler error: in get_expr_operands, at
tree-ssa-operands.c:882
0xfd18e9 get_expr_operands
        ../../gcc/tree-ssa-operands.c:882
0xfd24cd parse_ssa_operands
        ../../gcc/tree-ssa-operands.c:932
0xfd3d23 build_ssa_operands
        ../../gcc/tree-ssa-operands.c:947
0xfd3d23 update_stmt_operands(function*, gimple*)
        ../../gcc/tree-ssa-operands.c:1081
0xed1f4a update_stmt
        ../../gcc/gimple-ssa.h:175
0xed1f4a mark_def_sites
        ../../gcc/tree-into-ssa.c:649
0xed1f4a mark_def_dom_walker::before_dom_children(basic_block_def*)
        ../../gcc/tree-into-ssa.c:2346
0x16925c7 dom_walker::walk(basic_block_def*)
        ../../gcc/domwalk.c:353
0xed4619 execute
        ../../gcc/tree-into-ssa.c:2458

Reply via email to