[Bug tree-optimization/94216] New: [10 Regression] ICE in maybe_canonicalize_mem_ref_addr, at gimple-fold.c:4899 since r10-7237-g4e3d3e40726e1b68bf52fa205c68495124ea60b8

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 18 15:47:30 GMT 2020


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

            Bug ID: 94216
           Summary: [10 Regression] ICE in
                    maybe_canonicalize_mem_ref_addr, at gimple-fold.c:4899
                    since
                    r10-7237-g4e3d3e40726e1b68bf52fa205c68495124ea60b8
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: rguenth at gcc dot gnu.org
  Target Milestone: ---

I see the following ICE isolated from ade package:

$ cat /tmp/comm.ii
template <int _Nm> struct A { typedef int _Type[_Nm]; };
template <int _Nm> struct B {
  typename A<_Nm>::_Type _M_elems;
  void operator[](int) { int a = *_M_elems; }
};
class C {
  struct D {
    using type = int *;
  };

public:
  using pointer = D::type;
};
class F {
public:
  using pointer = C::pointer;
  F(pointer);
};
struct G {
  int data;
};
template <int MaxDimensions> struct H {
  using dimensions_t = B<MaxDimensions>;
  dimensions_t dimensions;
  G mem;
};
template <int MaxDimensions, typename Allocator, typename DimT, typename
AlignT>
H<MaxDimensions> alloc_view(int, DimT, AlignT, Allocator) {
  H<MaxDimensions> b;
  b.dimensions[0];
  return b;
}
namespace memory {
template <typename> using DynMdView = H<6>;
}
class I {
  I();
  memory::DynMdView<void> m_view;
  F m_memory;
};
int c, d, e;
I::I() : m_view(alloc_view<6>(c, d, e, [] {})), m_memory(&m_view.mem.data) {}

$ ./xgcc -B. /tmp/comm.ii -c -g -O 
during IPA pass: inline
/tmp/comm.ii: In constructor ‘I::I()’:
/tmp/comm.ii:42:1: internal compiler error: in maybe_canonicalize_mem_ref_addr,
at gimple-fold.c:4899
   42 | I::I() : m_view(alloc_view<6>(c, d, e, [] {})),
m_memory(&m_view.mem.data) {}
      | ^
0xeae3c7 maybe_canonicalize_mem_ref_addr
        ../../gcc/gimple-fold.c:4899
0xeaedda fold_stmt_1
        ../../gcc/gimple-fold.c:5046
0xeafb25 fold_stmt(gimple_stmt_iterator*)
        ../../gcc/gimple-fold.c:5307
0x1219414 fold_marked_statements
        ../../gcc/tree-inline.c:5341
0x12278f3 optimize_inline_calls(tree_node*)
        ../../gcc/tree-inline.c:5447
0x1b56403 inline_transform(cgraph_node*)
        ../../gcc/ipa-inline-transform.c:722
0x10c09ba execute_one_ipa_transform_pass
        ../../gcc/passes.c:2233
0x10c09ba execute_all_ipa_transforms(bool)
        ../../gcc/passes.c:2272
0xd24fcb cgraph_node::expand()
        ../../gcc/cgraphunit.c:2276
0xd2609f expand_all_functions
        ../../gcc/cgraphunit.c:2454
0xd2609f symbol_table::compile()
        ../../gcc/cgraphunit.c:2804
0xd2872c symbol_table::compile()
        ../../gcc/cgraphunit.c:2717
0xd2872c symbol_table::finalize_compilation_unit()
        ../../gcc/cgraphunit.c:2984
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


More information about the Gcc-bugs mailing list