[Bug tree-optimization/98192] Double free in SLP

marxin at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Dec 8 09:59:20 GMT 2020


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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
One more reduced test-case for x86_64-linux-gnu:

$ cat skcms.ii
template <int N, typename T> struct VecHelper {
  typedef T __attribute__((vector_size(N * sizeof(int)))) V;
};
template <int N, typename T> using Vec = typename VecHelper<N, T>::V;
template <typename T> using V = Vec<4, T>;
using Color = float;
using F = V<Color>;
using U32 = V<unsigned>;
template <typename T, typename P> void store(P, T);
template <typename D, typename S> D cast(S v) {
  D d;
  for (int i = 0; i < 4; i++)
    d[i] = v[i];
  return d;
}
F to_fixed_f;
U32 exec_ops_dst___trans_tmp_3;
void exec_ops_dst() {
  exec_ops_dst___trans_tmp_3 = U32(to_fixed_f);
  __attribute__((__vector_size__(4 * sizeof(int)))) unsigned __trans_tmp_1 =
      cast<U32>(exec_ops_dst___trans_tmp_3);
  store(exec_ops_dst, __trans_tmp_1);
}

$ g++ skcms.ii -c -O3
free(): double free detected in tcache 2
during GIMPLE pass: slp
skcms.ii: In function ‘void exec_ops_dst()’:
skcms.ii:18:6: internal compiler error: Aborted
   18 | void exec_ops_dst() {
      |      ^~~~~~~~~~~~
0x10539ef crash_signal
        /home/marxin/Programming/gcc/gcc/toplev.c:327
0x12e26cb void va_heap::release<_stmt_vec_info*>(vec<_stmt_vec_info*, va_heap,
vl_embed>*&)
        /home/marxin/Programming/gcc/gcc/vec.h:316
0x12e26cb vec<_stmt_vec_info*, va_heap, vl_ptr>::release()
        /home/marxin/Programming/gcc/gcc/vec.h:1832
0x12e26cb _bb_vec_info::~_bb_vec_info()
        /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:3401
0x12f13c0 vect_slp_region
        /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:4575
0x12f13c0 vect_slp_bbs
        /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:4645
0x12f3a64 vect_slp_function(function*)
        /home/marxin/Programming/gcc/gcc/tree-vect-slp.c:4731
0x12f5732 execute
        /home/marxin/Programming/gcc/gcc/tree-vectorizer.c:1436
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.


More information about the Gcc-bugs mailing list