When compiling the c++ compute component with gcc6/7 with std=c++14/17, compiler internal errors are triggered at compute/kernels/aggregate_internal.h:176:24 and various places at compute/kernels/scalar_set_lookup.cc
cpp/src/arrow/compute/kernels/aggregate_internal.h:176:24: internalcompilererror: inmaybe_undo_parenthesized_ref, atcp/semantics.c:1740DCHECK_LT(cur_level, levels);
~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
0x683399maybe_undo_parenthesized_ref(tree_node*)
../../gcc-7.5.0/gcc/cp/semantics.c:17390x6c8638cp_fold
../../gcc-7.5.0/gcc/cp/cp-gimplify.c:21800x6c949ccp_fold_maybe_rvalue
../../gcc-7.5.0/gcc/cp/cp-gimplify.c:20420x6c8346cp_fold
../../gcc-7.5.0/gcc/cp/cp-gimplify.c:21490x6c949ccp_fold_maybe_rvalue
../../gcc-7.5.0/gcc/cp/cp-gimplify.c:20420x6c8234cp_fold_rvalue
../../gcc-7.5.0/gcc/cp/cp-gimplify.c:20630x6c8234cp_fold
../../gcc-7.5.0/gcc/cp/cp-gimplify.c:23040x66a037cp_convert_and_check(tree_node*, tree_node*, int)
../../gcc-7.5.0/gcc/cp/cvt.c:6400x59bb8aconvert_like_real
../../gcc-7.5.0/gcc/cp/call.c:70530x59de12build_over_call
../../gcc-7.5.0/gcc/cp/call.c:78690x5a3c2fbuild_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, int)
../../gcc-7.5.0/gcc/cp/call.c:42720x685601finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int)
../../gcc-7.5.0/gcc/cp/semantics.c:25010x5e1b83tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-7.5.0/gcc/cp/pt.c:175080x5e121btsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-7.5.0/gcc/cp/pt.c:175440x5d6c47tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-7.5.0/gcc/cp/pt.c:167320x5d6c47tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:166130x5d6a85tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:158740x5d6ad5tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:158600x5d61detsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:160360x5d6ad5tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:15860Pleasesubmitafullbugreport,
withpreprocessedsourceifappropriate.
Pleaseincludethecompletebacktracewithanybugreport.
See <https://gcc.gnu.org/bugs/> for instructions.
cpp/src/arrow/compute/kernels/scalar_set_lookup.cc:70:50: internalcompilererror: inmaybe_undo_parenthesized_ref, atcp/semantics.c:1740autoon_found = [&](int32_tmemo_index) { DCHECK_LT(memo_index, memo_size); };
0x683399maybe_undo_parenthesized_ref(tree_node*)
../../gcc-7.5.0/gcc/cp/semantics.c:17390x6c8638cp_fold
../../gcc-7.5.0/gcc/cp/cp-gimplify.c:21800x6c949ccp_fold_maybe_rvalue
../../gcc-7.5.0/gcc/cp/cp-gimplify.c:20420x6c8346cp_fold
../../gcc-7.5.0/gcc/cp/cp-gimplify.c:21490x66a037cp_convert_and_check(tree_node*, tree_node*, int)
../../gcc-7.5.0/gcc/cp/cvt.c:6400x65f5d4cp_build_binary_op(unsignedint, tree_code, tree_node*, tree_node*, int)
../../gcc-7.5.0/gcc/cp/typeck.c:52080x5a689cbuild_new_op_1
../../gcc-7.5.0/gcc/cp/call.c:59780x5a737ebuild_new_op(unsigned int, tree_code, int, tree_node*, tree_node*, tree_node*, tree_node**, int)
../../gcc-7.5.0/gcc/cp/call.c:60220x657a12build_x_binary_op(unsigned int, tree_code, tree_node*, tree_code, tree_node*, tree_code, tree_node**, int)
../../gcc-7.5.0/gcc/cp/typeck.c:39410x5e04fftsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-7.5.0/gcc/cp/pt.c:170010x5e1120tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-7.5.0/gcc/cp/pt.c:169400x5e1120tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-7.5.0/gcc/cp/pt.c:169400x5e1676tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-7.5.0/gcc/cp/pt.c:173120x5e121btsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-7.5.0/gcc/cp/pt.c:175440x5d6c47tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
../../gcc-7.5.0/gcc/cp/pt.c:167320x5d6c47tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:166130x5d6a85tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:158740x5d696btsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:160900x5d696btsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:160900x5d4aaetsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc-7.5.0/gcc/cp/pt.c:15845Pleasesubmitafullbugreport,
withpreprocessedsourceifappropriate.
Pleaseincludethecompletebacktracewithanybugreport.
See <https://gcc.gnu.org/bugs/> for instructions. This is a known bug of gcc6/7. It is triggered when a const integer is capture by reference in a lambda function, and is parenthesized in that lambda code. See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83204 and kokkos/kokkos-kernels#349
An easy fix is to capture levels and memo_size by value. {}Since they are ints, capturing by value is also a performace improvement{}. If there is no objection, I will submit a PR to fix this.
Environment: gcc6/7
c++14/17
Reporter: Jin Shang / @js8544
Assignee: Jin Shang / @js8544
Related issues:
PRs and other links:
Note: This issue was originally created as ARROW-17567. Please see the migration documentation for further details.
When compiling the c++ compute component with gcc6/7 with std=c++14/17, compiler internal errors are triggered at compute/kernels/aggregate_internal.h:176:24 and various places at compute/kernels/scalar_set_lookup.cc
This is a known bug of gcc6/7. It is triggered when a const integer is capture by reference in a lambda function, and is parenthesized in that lambda code. See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83204 and kokkos/kokkos-kernels#349
An easy fix is to capture levels and memo_size by value. {
}Since they are ints, capturing by value is also a performace improvement{}. If there is no objection, I will submit a PR to fix this.Environment: gcc6/7
c++14/17
Reporter: Jin Shang / @js8544
Assignee: Jin Shang / @js8544
Related issues:
PRs and other links:
Note: This issue was originally created as ARROW-17567. Please see the migration documentation for further details.