Bug 89919 - [8/9 Regression] internal compiler error when building MKL-DNN
Summary: [8/9 Regression] internal compiler error when building MKL-DNN
Status: RESOLVED DUPLICATE of bug 87770
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 8.3.0
: P2 normal
Target Milestone: 8.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2019-04-02 07:20 UTC by Roman Dubtsov
Modified: 2019-04-03 15:06 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 7.4.0
Known to fail: 8.1.0
Last reconfirmed: 2019-04-02 00:00:00


Attachments
Reproducer (unpack before use) (323.69 KB, application/x-gzip)
2019-04-02 07:20 UTC, Roman Dubtsov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Dubtsov 2019-04-02 07:20:00 UTC
Created attachment 46072 [details]
Reproducer (unpack before use)

Disclaimer: I've built the gcc 8.3.0 (and gmp 6.1.2, mpc 1.1.0, mfpr 4.0.2) myself. The latter libraries were built using system's gcc 4.8.5. My system is RHEL 7.3. Here's full compiler output leading to the ICE:

$ g++ -v -std=c++11 -fvisibility-inlines-hidden  -Wall -Wno-unknown-pragmas -Werror -fvisibility=internal -march=native -mtune=native -fPIC -Wformat -Wformat-security -fstack-protector-strong -mtune=core-avx2 -march=core-avx2  -fopenmp -Wmissing-field-initializers -Wno-strict-overflow -O3 -c ref_rnn.ii
Using built-in specs.
COLLECT_GCC=g++
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-8.3.0/configure --prefix=/nfs/site/disks/hal9000/rsdubtso/work/tools/gcc/8.3.0 --with-gmp=/nfs/site/disks/hal9000/rsdubtso/work/tools/gmp/6.1.2 --with-mpfr=/nfs/site/disks/hal9000/rsdubtso/work/tools/mpfr/4.0.2 --with-mpc=/nfs/site/disks/hal9000/rsdubtso/work/tools/mpc/1.1.0
Thread model: posix
gcc version 8.3.0 (GCC)
COLLECT_GCC_OPTIONS='-v' '-std=c++11' '-fvisibility-inlines-hidden' '-Wall' '-Wno-unknown-pragmas' '-Werror' '-fvisibility=internal' '-march=native' '-mtune=native' '-fPIC' '-Wformat=1' '-Wformat-security' '-fstack-protector-strong' '-mtune=core-avx2' '-march=core-avx2' '-fopenmp' '-Wmissing-field-initializers' '-Wno-strict-overflow' '-O3' '-c' '-shared-libgcc' '-pthread'
 /nfs/site/disks/hal9000/rsdubtso/work/tools/gcc/8.3.0/libexec/gcc/x86_64-pc-linux-gnu/8.3.0/cc1plus -fpreprocessed ref_rnn.ii -march=broadwell -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a -mcx16 -msahf -mmovbe -maes -mno-sha -mpclmul -mpopcnt -mabm -mno-lwp -mfma -mno-fma4 -mno-xop -mbmi -mno-sgx -mbmi2 -mno-pconfig -mno-wbnoinvd -mno-tbm -mavx -mavx2 -msse4.2 -msse4.1 -mlzcnt -mrtm -mhle -mrdrnd -mf16c -mfsgsbase -mrdseed -mprfchw -madx -mfxsr -mxsave -mxsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf -mno-prefetchwt1 -mno-clflushopt -mno-xsavec -mno-xsaves -mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma -mno-avx512vbmi -mno-avx5124fmaps -mno-avx5124vnniw -mno-clwb -mno-mwaitx -mno-clzero -mno-pku -mno-rdpid -mno-gfni -mno-shstk -mno-avx512vbmi2 -mno-avx512vnni -mno-vaes -mno-vpclmulqdq -mno-avx512bitalg -mno-movdiri -mno-movdir64b --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=56320 -mtune=broadwell -quiet -dumpbase ref_rnn.ii -mtune=core-avx2 -march=core-avx2 -auxbase ref_rnn -O3 -Wall -Wno-unknown-pragmas -Werror -Wformat=1 -Wformat-security -Wmissing-field-initializers -Wno-strict-overflow -std=c++11 -version -fvisibility-inlines-hidden -fvisibility=internal -fPIC -fstack-protector-strong -fopenmp -o /tmp/ccYvBIFy.s
GNU C++11 (GCC) version 8.3.0 (x86_64-pc-linux-gnu)
        compiled by GNU C version 8.3.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C++11 (GCC) version 8.3.0 (x86_64-pc-linux-gnu)
        compiled by GNU C version 8.3.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 70d646653fc51eb1ee1071a26be406d8
/nfs/pdx/home/rsdubtso/work/ml/mkl-dnn/mkl-dnn/src/cpu/rnn/ref_rnn.cpp: In instantiation of ‘void mkldnn::impl::cpu::_ref_rnn_common_t<aprop, src_type, weights_type>::copy_init_iter(const mkldnn::impl::cpu::rnn_utils::rnn_conf_t&, mkldnn::impl::cpu::_ref_rnn_common_t<aprop, src_type, weights_type>::src_data_t*, float*, float*, const input_data_t*, const float*) const [with input_data_t = float; mkldnn_prop_kind_t aprop = (mkldnn_prop_kind_t)128; mkldnn_data_type_t src_type = (mkldnn_data_type_t)1; mkldnn_data_type_t weights_type = (mkldnn_data_type_t)1; mkldnn::impl::cpu::_ref_rnn_common_t<aprop, src_type, weights_type>::src_data_t = float]’:
/nfs/pdx/home/rsdubtso/work/ml/mkl-dnn/mkl-dnn/src/cpu/rnn/ref_rnn.cpp:726:9:   required from ‘void mkldnn::impl::cpu::_ref_rnn_common_t<aprop, src_type, weights_type>::execute_(const mkldnn::impl::exec_ctx_t&) const [with mkldnn_prop_kind_t aprop = (mkldnn_prop_kind_t)128; mkldnn_data_type_t src_type = (mkldnn_data_type_t)1; mkldnn_data_type_t weights_type = (mkldnn_data_type_t)1]’
/nfs/pdx/home/rsdubtso/work/ml/mkl-dnn/mkl-dnn/src/cpu/rnn/ref_rnn.cpp:763:17:   required from here
/nfs/pdx/home/rsdubtso/work/ml/mkl-dnn/mkl-dnn/src/cpu/rnn/ref_rnn.cpp:385:20: internal compiler error: in type_dependent_expression_p, at cp/pt.c:25191
         parallel_nd(rnn.n_layer, rnn.n_dir, rnn.n_states, rnn.mb,
         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                 [&](int lay, int dir, int state, int b) {
                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     array_copy(&(ws_diff_states(
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                        lay, dir, state, rnn.n_iter, b, 0)),
                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                             diff_dst_iter_
                             ~~~~~~~~~~~~~~
                                     + diff_dst_iter_d.blk_off(
                                     ~~~~~~~~~~~~~~~~~~~~~~~~~~
                                               lay, dir, state, b),
                                               ~~~~~~~~~~~~~~~~~~~~
                             rnn.dic);
                             ~~~~~~~~~
                 });
                 ~~
0x58d918 type_dependent_expression_p(tree_node*)
        ../../gcc-8.3.0/gcc/cp/pt.c:25190
0x58d918 type_dependent_expression_p(tree_node*)
        ../../gcc-8.3.0/gcc/cp/pt.c:25029
0x6ab7c5 uses_template_parms(tree_node*)
        ../../gcc-8.3.0/gcc/cp/pt.c:10032
0x6b3eab tsubst_copy
        ../../gcc-8.3.0/gcc/cp/pt.c:15439
0x6bd700 tsubst_copy
        ../../gcc-8.3.0/gcc/cp/pt.c:18891
0x6bd700 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:18891
0x6c61e3 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        ../../gcc-8.3.0/gcc/cp/pt.c:17591
0x6be6ef tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:18971
0x6be1d1 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:18313
0x6b17c2 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:17446
0x6b15a5 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:16644
0x6b0e18 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:16630
0x6b0d03 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:16930
0x6b2167 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:16900
0x6b0e18 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:16630
0x6b0d03 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:16930
0x6af988 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:16615
0x6af988 instantiate_decl(tree_node*, bool, bool)
        ../../gcc-8.3.0/gcc/cp/pt.c:24066
0x6cef73 instantiate_pending_templates(int)
        ../../gcc-8.3.0/gcc/cp/pt.c:24182
0x62eba8 c_parse_final_cleanups()
        ../../gcc-8.3.0/gcc/cp/decl2.c:4715
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.
Comment 1 Martin Liška 2019-04-02 08:21:53 UTC
I'm reducing that..
Comment 2 Martin Liška 2019-04-02 08:22:49 UTC
@Roman: Do you have a GCC compiler that accepts the code and does not cause an ICE?
Comment 3 Martin Liška 2019-04-02 08:46:56 UTC
I have a reduced test-case:

$ cat pr89919.ii
typedef enum { a } b;
using c = b;
float d, e;
template <c> struct f {
  typedef float g;
  void h() const;
  template <typename i>
  void j(const int &, g *, float *, float *, const i *, const float *) const;
};
using k = f<a>;
template <>
template <typename i>
void k::j(const int &, g *, float *, float *, const i *, const float *) const;
template <>
template <typename i>
void k::j(const int &, g *, float *, float *, const i *, const float *) const {
  int l([&] { l; });
}
template <c m> void f<m>::h() const {
  int n;
  g o;
  j(n, &o, &d, &e, static_cast<char *>(0), 0);
}
template struct f<a>;

Rejected on trunk again in r268529, started to ICE in r249323.
Comment 4 Roman Dubtsov 2019-04-02 15:08:32 UTC
@Martin: I'm not sure how useful this info after bisection has been done, but FWIW 8.1.0 ICEs and and 7.4.0 does not.
Comment 5 Jason Merrill 2019-04-03 15:06:41 UTC
Fixed on trunk by the patch for 87770.

*** This bug has been marked as a duplicate of bug 87770 ***