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

            Bug ID: 67211
           Summary: [5 Regression] ICE (insn does not satisfy its
                    constraints) on powerpc64le-linux-gnu
           Product: gcc
           Version: 5.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: doko at gcc dot gnu.org
  Target Milestone: ---

seen with r226731 from the gcc-5-branch, fails with -O3, succeeds with -O2. on
powerpc64le-linux-gnu. not seen with r226068 on the trunk.

$ g++ -c -g -O3 structure.ii
structure.ii:38:3: warning: anonymous type with no linkage used to declare
variable '<anonymous struct> a' with linkage
 } a;
   ^
structure.ii: In function 'void Linked()':
structure.ii:42:1: error: insn does not satisfy its constraints:
 }
 ^
(insn 305 170 306 8 (set (reg:DI 9 9)
        (reg/f:DI 63 31 [orig:184 p3$_M_node ] [184])) structure.ii:20 554
{*movdi_internal64}
     (nil))
structure.ii:42:1: internal compiler error: in extract_constrain_insn, at
recog.c:2246
0x107528d3 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../src/gcc/rtl-error.c:110
0x1075292b _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../src/gcc/rtl-error.c:121
0x1071b7e7 extract_constrain_insn(rtx_insn*)
        ../../src/gcc/recog.c:2246
0x106f8527 reload_cse_simplify_operands
        ../../src/gcc/postreload.c:430
0x106f9983 reload_cse_simplify
        ../../src/gcc/postreload.c:207
0x106f9983 reload_cse_regs_1
        ../../src/gcc/postreload.c:246
0x106fb697 reload_cse_regs
        ../../src/gcc/postreload.c:94
0x106fb697 execute
        ../../src/gcc/postreload.c:2387
Please submit a full bug report,
with preprocessed source if appropriate.

$ cat structure.ii
template <typename _InputIterator, typename _ForwardIterator>
void find_first_of(_InputIterator, _InputIterator, _ForwardIterator p3,
                   _ForwardIterator p4) {
  for (; p3 != p4; ++p3)
    ;
}

template <typename, typename, typename> struct A {
  int _S_buffer_size;
  int *_M_cur;
  int *_M_first;
  int *_M_last;
  int **_M_node;
  void operator++() {
    if (_M_cur == _M_last)
      m_fn1(_M_node + 1);
  }
  void m_fn1(int **p1) {
    _M_node = p1;
    _M_first = *p1;
    _M_last = _M_first + _S_buffer_size;
  }
};

template <typename _Tp, typename _Ref, typename _Ptr>
bool operator==(A<_Tp, _Ref, _Ptr>, A<_Tp, _Ref, _Ptr>);
template <typename _Tp, typename _Ref, typename _Ptr>
bool operator!=(A<_Tp, _Ref, _Ptr> p1, A<_Tp, _Ref, _Ptr> p2) {
  return p1 == p2;
}

class B {
public:
  A<int, int, int> m_fn2();
};
struct {
  B j;
} a;
void Linked() {
  A<int, int, int> b, c, d;
  find_first_of(d, c, b, a.j.m_fn2());
}

Reply via email to