]> git.feebdaed.xyz Git - 0xmirror/gcc.git/commit
forwprop: Check type conversion in pack/unpack [PR123117].
authorRobin Dapp <rdapp@qti.qualcomm.com>
Mon, 15 Dec 2025 12:01:40 +0000 (13:01 +0100)
committerRobin Dapp <rdapp@oss.qualcomm.com>
Fri, 19 Dec 2025 18:41:53 +0000 (19:41 +0100)
commite8fd095091ebfc0c4adc1c7f6607ab30b25b3a05
tree6189e9011574da8bfb2dd95e35055531c22e0702
parent2fd0ba5e5eef177f4e19ea015eb702824ed9d3c4
forwprop: Check type conversion in pack/unpack [PR123117].

When using pack or unpack in the simplification of a vector constructor
we must make sure that the original BIT_FIELD_REF was no sign-changing
nop conversion.  If it was we cannot safely pack/unpack as that would
skip sign or zero extensions.  This patch adds useless_type_conversion_p
to both paths.

PR tree-optimization/123117

gcc/ChangeLog:

* tree-ssa-forwprop.cc (simplify_vector_constructor):
Check if we had a nop conversion and don't use pack/unpack in
that case.

gcc/testsuite/ChangeLog:

* gcc.target/loongarch/vector/lsx/pr123117.c: New test.
gcc/testsuite/gcc.target/loongarch/vector/lsx/pr123117.c [new file with mode: 0644]
gcc/tree-ssa-forwprop.cc