https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122679
Bug ID: 122679
Summary: simplify_vector_constructor () doesn't emit VEC_PERMs
for non-vector modes
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: artemiyv at gcc dot gnu.org
Target Milestone: ---
All of the functions in the tree-ssa/forwprop-43.c testcase fail on
arm-gnueabihf when compiling without vector support, for instance:
$ cat forwprop-43.c
#include <stdint.h>
typedef int32_t int32x4_t __attribute__((vector_size(16)));
typedef int32_t int32x2_t __attribute__((vector_size(8)));
typedef int32_t int32x1_t __attribute__((vector_size(4)));
int32x4_t __GIMPLE (ssa)
foo (int32x4_t x)
{
int32x2_t _1;
int32x2_t _2;
int32x4_t _6;
__BB(2):
_1 = __BIT_FIELD_REF <int32x2_t> (x, 64, 64);
_2 = __BIT_FIELD_REF <int32x2_t> (x, 64, 0);
_6 = _Literal (int32x4_t) { _1, _2 };
return _6;
}
$ /work/install/gcc-arm32/bin/arm-linux-gnueabihf-gcc forwprop-43.c -O2
-fdump-tree-forwprop1 -fgimple -S -I/usr/arm-linux-gnueabihf/include
-march=armv7-a -mfpu=vfpv3-d16
$ cat forwprop-43.c.039t.forwprop1
;; Function foo (foo, funcdef_no=0, decl_uid=6319, cgraph_uid=1,
symbol_order=0)
int32x4_t foo (int32x4_t x)
{
vector(2) int _1;
vector(2) int _2;
vector(4) int _6;
<bb 2> :
_1 = BIT_FIELD_REF <x_7(D), 64, 64>;
_2 = BIT_FIELD_REF <x_7(D), 64, 0>;
_6 = {_1, _2};
return _6;
}
The VEC_PERM_EXPR isn't produced at least because the can_vec_perm_const_p ()
check on line 4120 fails (for starters, it requires a vector mode, and _6 has
TImode).
gcc -v output:
$ /work/install/gcc-arm32/bin/arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=/work/install/gcc-arm32/bin/arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/work/install/gcc-arm32/libexec/gcc/arm-linux-gnueabihf/16.0.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../../src/gcc/configure --target arm-linux-gnueabihf
--disable-bootstrap --disable-gcov --disable-threads --enable-languages=c,c++
--prefix=/work/install/gcc-arm32 --enable-multilib
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20251113 (experimental) (GCC)