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

--- Comment #2 from Mathieu Malaterre <malat at debian dot org> ---
reduced:

% g++  -maltivec -mcpu=power8 -O2 -c testcase.i
testcase.i:15:30: warning: '{anonymous}::m<f []> {anonymous}::n(a) [with f =
short int]' used but never defined
   15 | template <typename f> m<f[]> n(a);
      |                              ^
testcase.i: In function 'void f::o::b()':
testcase.i:66:25: error: unrecognizable insn:
   66 | void b() { bo(bj<s>()); }
      |                         ^
(insn 14 10 15 2 (set (reg:DI 127)
        (ashift:DI (reg:DI 126)
            (const_int 56 [0x38]))) "testcase.i":61:8 -1
     (nil))
during RTL pass: vregs
testcase.i:66:25: internal compiler error: in extract_insn, at recog.cc:2791
0x10813967 internal_error(char const*, ...)
        ???:0
0x10813a77 fancy_abort(char const*, int, char const*)
        ???:0
0x1041cb67 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ???:0
0x1041cba3 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ???:0
0x10bc12b7 extract_insn(rtx_insn*)
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-13/README.Bugs> for instructions.


with:

% cat testcase.i
typedef int a;
typedef short b;
namespace c {
template <typename e> struct g { using h = e &; };
template <typename e> using i = typename g<e>::h;
template <typename e> struct k { using h = i<e>; };
template <typename e, typename = e> class ad;
template <typename e, typename l> class ad<e[], l> {
public:
  typename k<e>::h operator[](a);
};
} // namespace c
namespace {
template <typename f> using m = c::ad<f>;
template <typename f> m<f[]> n(a);
} // namespace
#pragma GCC target "cpu=power10"
namespace f {
namespace o {
template <typename q, a, int> struct p { using f = q; };
namespace detail {
template <typename f, a, int> struct aq { using h = p<f, 6, 0>; };
template <typename f, a, int as> struct at {
  static constexpr a au = 0;
  using h = typename aq<f, au, as>::h;
};
} // namespace detail
template <typename f, a aw, int as>
using ax = typename detail::at<f, aw, as>::h;
template <class ay> using az = typename ay::f;
namespace detail {
template <typename f, a, a bc, class bd, int as> struct be {
  static void bf(a, a) {
    ax<f, bc, as> d;
    bd()(f(), d);
  }
};
} // namespace detail
template <class bd, int as> class bg {
public:
  template <typename f> void operator()(f) {
    a bh;
    constexpr a bi = as;
    constexpr a bc{};
    detail::be<f, bi, bc, bd, as>::bf(1, bh);
  }
};
template <class bd> class bj {
public:
  template <typename f> void operator()(f r) { bg<bd, 0>()(r); }
};
template <class bk> void bl(bk bm) { bm(b()); }
template <class bk> void bn(bk bm) { bl(bm); }
template <class bk> void bo(bk bm) { bn(bm); }
struct s {
  template <class f, class ay> void operator()(f, ay) {
    ay bp;
    using bq = az<decltype(bp)>;
    a br;
    auto bs = n<bq>(br);
    bq bt[]{8, 5, 4, 4, 5, 4, 9, 8, 5};
    for (a j;;)
      bs[j] = bt[j];
  }
};
void b() { bo(bj<s>()); }
} // namespace o
} // namespace f

Reply via email to