Bug 111212 - [13/14 Regression] internal compiler error: in extract_insn, at recog.cc:2791
Summary: [13/14 Regression] internal compiler error: in extract_insn, at recog.cc:2791
Status: RESOLVED DUPLICATE of bug 96762
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 13.2.0
: P3 normal
Target Milestone: 13.3
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2023-08-28 07:54 UTC by Mathieu Malaterre
Modified: 2023-08-30 02:42 UTC (History)
2 users (show)

See Also:
Host:
Target: powerpc
Build:
Known to work: 12.3.0
Known to fail: 13.2.0
Last reconfirmed:


Attachments
Preprocessed source (516.91 KB, application/x-gzip)
2023-08-28 07:54 UTC, Mathieu Malaterre
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Malaterre 2023-08-28 07:54:46 UTC
Created attachment 55806 [details]
Preprocessed source

I cannot compile highway on powerpc (Debian/ppc32). It fails with:

/home/malat/highway/hwy/tests/table_test.cc:189:3: error: unrecognizable insn:
  189 |   }
      |   ^
(insn 231 227 232 8 (set (reg:DI 192)
        (ashift:DI (reg:DI 191)
            (const_int 56 [0x38]))) "/home/malat/highway/hwy/tests/table_test.cc":165:22 -1
     (nil))
during RTL pass: vregs
/home/malat/highway/hwy/tests/table_test.cc:189:3: 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.
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-13/README.Bugs> for instructions.
Preprocessed source stored into /tmp/cciw5XZG.out file, please attach this to your bugreport.
Comment 1 Mathieu Malaterre 2023-08-28 07:56:03 UTC
Compilation line:

 % /usr/bin/c++ -freport-bug -DHWY_STATIC_DEFINE -DTOOLCHAIN_MISS_ASM_HWCAP_H -I/home/malat/highway -maltivec -mcpu=power8 -O2 -g -DNDEBUG -fPIE -fvisibility=hidden -fvisibility-inlines-hidden -Wno-builtin-macro-redefined -D__DATE__=\"redacted\" -D__TIMESTAMP__=\"redacted\" -D__TIME__=\"redacted\" -fmerge-all-constants -Wall -Wextra -Wconversion -Wsign-conversion -Wvla -Wnon-virtual-dtor -fmath-errno -fno-exceptions -DHWY_IS_TEST=1 -DGTEST_HAS_PTHREAD=1 -MD -MT CMakeFiles/table_test.dir/hwy/tests/table_test.cc.o -MF CMakeFiles/table_test.dir/hwy/tests/table_test.cc.o.d -o CMakeFiles/table_test.dir/hwy/tests/table_test.cc.o -c /home/malat/highway/hwy/tests/table_test.cc
Comment 2 Mathieu Malaterre 2023-08-28 14:48:41 UTC
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
Comment 3 Kewen Lin 2023-08-30 02:31:24 UTC
Thanks for reporting.  lxvl isn't valid for 32bit env, this is duplicated of PR96762. Haochen had posted a patch to fix it: https://gcc.gnu.org/pipermail/gcc-patches/2023-August/628637.html, I've reviewed and approved it, it should be landed soon.

*** This bug has been marked as a duplicate of bug 96762 ***
Comment 4 Kewen Lin 2023-08-30 02:42:46 UTC
btw, I think the field "known to work" isn't quite exact, at least I verified it failed with powerpc64 gcc 12.3.0 with -m32, as which release PR96762 was filed for, I'd expect it also fail for gcc 11.4.0.