https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99881
H.J. Lu <hjl.tools at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-04-02 Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> --- (In reply to Hongtao.liu from comment #0) > testcase is extracted from 557.xz_r > > void > foo (int* __restrict a, int n, int c) > { > a[0] = n; > a[1] = c; > } > > gcc -O2 -ftree-vectorize -fvect-cost-model=very-cheap > > foo(int*, int, int): > movd xmm0, esi > movd xmm1, edx > punpckldq xmm0, xmm1 > movq QWORD PTR [rdi], xmm0 > ret > > without vectorization > > foo(int*, int, int): > mov DWORD PTR [rdi], esi > mov DWORD PTR [rdi+4], edx > ret > > cost model: > scalar: 2 times scalar_store costs 24, > vector: 1 times unaligned_store costs 12, vec_contruct 8 How is vec_contruct cost computed today?