On Tue, 2025-12-16 at 11:58 +0100, Robin Dapp wrote:
> Hi,
>
> 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.
>
> Bootstrapped and regtested on x86 and power10. On power10 I surprisingly
> saw one algol68 failure with the patch but that can only be unrelated and due
> to the build environment. Re-testing in progress.
>
> Regtested on riscv64 and aarch64, and loongarch64 via qemu.
>
> I tried coming up with an x86 test case but failed. Suggestions welcome.
I tried that and failed too.
/* snip */
> diff --git a/gcc/testsuite/gcc.target/loongarch/vector/lsx/pr123117.c
> b/gcc/testsuite/gcc.target/loongarch/vector/lsx/pr123117.c
> new file mode 100644
> index 00000000000..e16a7204ef4
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/loongarch/vector/lsx/pr123117.c
> @@ -0,0 +1,17 @@
> +/* { dg-do run } */
This should be removed. loongarch-vector.exp will decide on dg-do run
or dg-do compile based on the CPU capability for everything in the lsx
directory. Forcing it to run will cause a SIGILL on hardware w/o LSX.
> +/* { dg-options "-mlsx -DARCH_LOONGARCH64 -O1 -static" } */
-DARCH_LOONGARCH64 and -static should be unneeded (I already removed
ARCH_LOONGARCH64 when I reduced the original test case).
--
Xi Ruoyao <[email protected]>