https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82954
Bug ID: 82954 Summary: [8 regression] ICE in fold_binary_loc, at fold-const.c:9061 Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: trippels at gcc dot gnu.org CC: jakub at gcc dot gnu.org Target Milestone: --- trippels@gcc67 ~ % cat stun.ii struct A { struct { int __u6_addr8; } __in6_u; }; struct B { B(A &); }; unsigned a[0]; struct C { B m_fn1() const; }; B C::m_fn1() const { A b; unsigned *c = reinterpret_cast<unsigned *>(b.__in6_u.__u6_addr8); c[0] = c[0] ^ 1; c[1] = c[1] ^ 1; c[2] = c[2] ^ a[0]; c[3] = c[3] ^ a[1]; return b; } trippels@gcc67 ~ % g++ -O2 -c stun.ii during GIMPLE pass: store-merging stun.ii: In member function ‘B C::m_fn1() const’: stun.ii:13:3: internal compiler error: in fold_binary_loc, at fold-const.c:9061 B C::m_fn1() const { ^ 0xa96e20 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*, tree_node*) ../../gcc/gcc/fold-const.c:9058 0xa9d9da fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*, tree_node*) ../../gcc/gcc/fold-const.c:12114 0x1524096 output_merged_store ../../gcc/gcc/gimple-ssa-store-merging.c:1873 0x1525d24 output_merged_stores ../../gcc/gcc/gimple-ssa-store-merging.c:2066 0x1525d24 terminate_and_process_chain ../../gcc/gcc/gimple-ssa-store-merging.c:2104 0x1525d24 terminate_and_release_chain ../../gcc/gcc/gimple-ssa-store-merging.c:996 0x1526234 terminate_all_aliasing_chains ../../gcc/gcc/gimple-ssa-store-merging.c:979 0x152684c process_store ../../gcc/gcc/gimple-ssa-store-merging.c:2403 0x152684c execute ../../gcc/gcc/gimple-ssa-store-merging.c:2511